Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp479722pxk; Wed, 2 Sep 2020 06:57:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRvJe++bEynJExpYJwkjy/rLFbmOgneIrV0UFDPYyBohrBy5RHBiRrYw+9gvZ/f4hOCFJ3 X-Received: by 2002:a17:906:2b97:: with SMTP id m23mr126381ejg.61.1599055048159; Wed, 02 Sep 2020 06:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599055048; cv=none; d=google.com; s=arc-20160816; b=spX8Fco5KRa129EcwH8LsdGvtTkl8/CM2t2v0mTweTkTAaGYmYzzHTFH+aMsvbGwaI 2WPWKI3E9AdtmZNa/oLL8153UfKzJ1dgKVkKKsJ3cT1TKwE/f6Fqg1OCcV+nurxLigRj 20+UcmgvIw7q9kssjdIy9xuIK48ggElvTHKG3xSEHZOywSQLraradrfKySizwWgcyI/h zksvc/IAjXo9Vps4LDk/ZaNsBKZ8Ot3YL+3acJcUEKdZTcdsoGH/Nh98ysUtWKX7Kr9e 2unJuyBaevmNO7VR81/jDgUnEOC/QIEv5C+I3OQjjIe+seL9aQIOpSPNxOCX/FbwoCT5 Fu+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sLL3k4BQ7acDmZ59Y3X+0YphVFs1wODTtUpPDy2CML4=; b=SDDlrltHoSNarKLMAjpz2ow2TmzVTchYmZKflc8L/Bil8MGWdG6UMbnRnZLr/Ij/+N sWv0Fi/kfl5gF50yPrO+MpDY9gdjD+mokAqCfT2zXdIXBFmJIS4ArWR1IfXhhpITQi8D OjwBVjpyoSMcec2VEwt1c62wdu7JlGkPwsUj9PK9U68FkxVCmVockAP7Iudyn8MJCm0K 6SgRn5t4B93iW+KuBD1B00S5u4oQ2gmW8cT6RZK4NeaH3mfE0veygFrx4MGzZ2xFltH1 zQFApW4dio3z3iSzLLYy/7iDbHpDZrw3p3pIpYk6hkPZMkJQAizrlyD/TA7HnreHrWbZ ZcuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si2576342ejg.609.2020.09.02.06.57.03; Wed, 02 Sep 2020 06:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726882AbgIBNwl (ORCPT + 99 others); Wed, 2 Sep 2020 09:52:41 -0400 Received: from verein.lst.de ([213.95.11.211]:60150 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727853AbgIBNoo (ORCPT ); Wed, 2 Sep 2020 09:44:44 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id AC30268B02; Wed, 2 Sep 2020 15:44:35 +0200 (CEST) Date: Wed, 2 Sep 2020 15:44:35 +0200 From: Christoph Hellwig To: Ming Lei Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Sagi Grimberg , Tejun Heo , Christoph Hellwig , Jens Axboe , Bart Van Assche Subject: Re: [PATCH V2 1/2] percpu_ref: reduce memory footprint of percpu_ref in fast path Message-ID: <20200902134435.GA32502@lst.de> References: <20200902122643.634143-1-ming.lei@redhat.com> <20200902122643.634143-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902122643.634143-2-ming.lei@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 08:26:42PM +0800, Ming Lei wrote: > 'struct percpu_ref' is often embedded into one user structure, and the > instance is usually referenced in fast path, however actually only > 'percpu_count_ptr' is needed in fast path. > > So move other fields into one new structure of 'percpu_ref_data', and > allocate it dynamically via kzalloc(), then memory footprint of > 'percpu_ref' in fast path is reduced a lot and becomes suitable to put > into hot cacheline of user structure. This looks good: Reviewed-by: Christoph Hellwig