From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 6F5331F404 for ; Mon, 19 Mar 2018 19:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936038AbeCSTjU (ORCPT ); Mon, 19 Mar 2018 15:39:20 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:46235 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935836AbeCSTjR (ORCPT ); Mon, 19 Mar 2018 15:39:17 -0400 Received: by mail-pg0-f53.google.com with SMTP id g8so4200073pgq.13 for ; Mon, 19 Mar 2018 12:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ja47wDgxSNQScv5PCe3sKvZR5xjMFR8o+ilTayMPoEk=; b=n48NV+mfnMKuCmg+r+GcAqVK1WHwfMtrSXn+2Meng4RKuAno8I3IJnuc8v0ORj+lqH OX7DATelKXBJDK+OBrKA1dGBPLsZAGjez4h9Z/GI7WzkxGljQgQX5EKsZPsZnePSEaFP RZXh84vBo3ULnKwsrKsEyNxrM/mJfBRiaWUA3djDAJXhrj62UR4p8r4uW0g0jd46lmEU mKwd/JM1hU/yhRNRixvAnQoQa9rr+/ohLDdrdZfecm2o2dq++rX6u19xSHpXIwxyBDm2 hiIJnTP5UW/u5l6JJYK9QyNrD8QuXl9s/clOxq5n4Atwh0DGjnpzan/DXK7nvO3O/aJA wPTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ja47wDgxSNQScv5PCe3sKvZR5xjMFR8o+ilTayMPoEk=; b=P2wZHnfFAH/NVZJZ1MS6fXrU9dZuzkaw4s9C+1rxw6g+C2wXj5eN5iaeZbNdlwMHWj c4OC3hC3pZxfRB4xw5zZJ0xur0BRUph4o/VJIU4InxGv9Tp9lxqt506KA+H9LWqyuBVD cwGflesndxiZE4Sq3GQcRvUqn67Fxns9jV4CRen1jGoXYz9OHn2CMsSSE+IoNHR3kbyz OAkz3Th6cXxHLq8bIk7OVHe54T93LU0EMNCaLiFnULf19MY04tLZcrg98iUFpfH3q1Dl gfAV/NuYlIWylFxgJwBM6+FsFrsyp+jmvPVzKuBB37TEZc6vTfLdcX3JvFKErL2gQ4+k vrbg== X-Gm-Message-State: AElRT7FuvpIMa73+0SDOasI/e1Js7h3XsCb5YrrBWG+Tmti/zzqA8vxC RPTTUpQTt3L6gAxmxLq7mt7lgrz8CkU= X-Google-Smtp-Source: AG47ELuz3/kljEP7PdWpB9BGQqLlSeQbKrDBMtPGCxJLxZuuHenpHBw7zxDvXrXH5+c8FcWtmdrCWA== X-Received: by 10.98.73.214 with SMTP id r83mr2536116pfi.76.1521488356715; Mon, 19 Mar 2018 12:39:16 -0700 (PDT) Received: from twelve3.svl.corp.google.com ([2620:0:100e:422:ffac:c1d4:4bf7:bb93]) by smtp.gmail.com with ESMTPSA id p9sm1251106pfk.12.2018.03.19.12.39.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 12:39:15 -0700 (PDT) Date: Mon, 19 Mar 2018 12:39:14 -0700 From: Jonathan Tan To: =?UTF-8?B?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy Cc: git@vger.kernel.org, Junio C Hamano , Stefan Beller , Jonathan Nieder Subject: Re: [PATCH 10/44] object-store: move packed_git and packed_git_mru to object store Message-Id: <20180319123914.6767c0660fb3e77247f02989@google.com> In-Reply-To: <20180303113637.26518-11-pclouds@gmail.com> References: <20180303113637.26518-1-pclouds@gmail.com> <20180303113637.26518-11-pclouds@gmail.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, 3 Mar 2018 18:36:03 +0700 Nguyễn Thái Ngọc Duy wrote: > From: Stefan Beller > > In a process with multiple repositories open, packfile accessors > should be associated to a single repository and not shared globally. > Move packed_git and packed_git_mru into the_repository and adjust > callers to reflect this. > > [nd: while at there, wrap access to these two fields in get_packed_git() > and get_packed_git_mru(). This allows us to lazily initialize these > fields without caller doing that explicitly] The patches up to this one look good. (I didn't reply for each individual one to avoid unnecessarily sending messages to the list.) About this patch: will lazily initializing these fields be done in a later patch? > Patch generated by > > 1. Moving the struct packed_git declaration to object-store.h > and packed_git, packed_git_mru globals to struct object_store. > > 2. Apply the following semantic patch to adjust callers: > @@ @@ > - packed_git > + the_repository->objects.packed_git > > @@ @@ > - packed_git_mru > + the_repository->objects.packed_git_mru This doesn't seem up-to-date - they are being replaced with a function call, not a field access. I would be OK with just removing this "Patch generated by" section. [snip remainder of "Patch generated by" section] > @@ -246,7 +244,7 @@ static int unuse_one_window(struct packed_git *current) > > if (current) > scan_windows(current, &lru_p, &lru_w, &lru_l); > - for (p = packed_git; p; p = p->next) > + for (p = the_repository->objects.packed_git; p; p = p->next) > scan_windows(p, &lru_p, &lru_w, &lru_l); > if (lru_p) { > munmap(lru_w->base, lru_w->len); Here (and elsewhere), "the_repository->objects.packed_git" instead of "get_packed_git" is still used.