lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201001153806.GA23222@T590>
Date:   Thu, 1 Oct 2020 23:38:06 +0800
From:   Ming Lei <ming.lei@...hat.com>
To:     Tejun Heo <tj@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
        Veronika Kabatova <vkabatov@...hat.com>,
        Christoph Hellwig <hch@....de>,
        Sagi Grimberg <sagi@...mberg.me>, Jens Axboe <axboe@...nel.dk>,
        Bart Van Assche <bvanassche@....org>
Subject: Re: [PATCH V6 1/2] percpu_ref: reduce memory footprint of percpu_ref
 in fast path

On Wed, Sep 30, 2020 at 12:00:15PM -0400, Tejun Heo wrote:
> On Wed, Sep 30, 2020 at 04:26:56PM +0800, Ming Lei wrote:
> > diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
> > index 87d8a38bdea1..1d6ed9ca23dd 100644
> > --- a/include/linux/percpu-refcount.h
> > +++ b/include/linux/percpu-refcount.h
> > @@ -92,18 +92,23 @@ enum {
> >  	PERCPU_REF_ALLOW_REINIT	= 1 << 2,
> >  };
> >  
> > -struct percpu_ref {
> > +struct percpu_ref_data {
> >  	atomic_long_t		count;
> > -	/*
> > -	 * The low bit of the pointer indicates whether the ref is in percpu
> > -	 * mode; if set, then get/put will manipulate the atomic_t.
> > -	 */
> > -	unsigned long		percpu_count_ptr;
> >  	percpu_ref_func_t	*release;
> >  	percpu_ref_func_t	*confirm_switch;
> >  	bool			force_atomic:1;
> >  	bool			allow_reinit:1;
> >  	struct rcu_head		rcu;
> > +	struct percpu_ref	*ref;
> > +};
> > +
> > +struct percpu_ref {
> > +	/*
> > +	 * The low bit of the pointer indicates whether the ref is in percpu
> > +	 * mode; if set, then get/put will manipulate the atomic_t.
> > +	 */
> > +	unsigned long		percpu_count_ptr;
> > +	struct percpu_ref_data  *data;
> >  };
> 
> Can you please add a comment explaining why the two structs are split?

Sure, will do that in next version.

Thanks,
Ming

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ