public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Waiman Long <waiman.long@hpe.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Jan Kara <jack@suse.com>, Jeff Layton <jlayton@poochiereds.net>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andi Kleen <andi@firstfloor.org>,
	Dave Chinner <dchinner@redhat.com>,
	Scott J Norton <scott.norton@hpe.com>,
	Douglas Hatch <doug.hatch@hpe.com>
Subject: Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks
Date: Fri, 15 Apr 2016 07:33:34 +0800	[thread overview]
Message-ID: <20160414233334.GA21026@fixme-laptop.cn.ibm.com> (raw)
In-Reply-To: <570E8419.7090909@hpe.com>

[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]

On Wed, Apr 13, 2016 at 01:38:33PM -0400, Waiman Long wrote:
> On 04/12/2016 10:09 PM, Boqun Feng wrote:
> > Hi Waiman,
> > 
> > On Tue, Apr 12, 2016 at 06:54:43PM -0400, Waiman Long wrote:
> > [...]
> > > +
> > > +/*
> > > + * Initialize the per-cpu list head
> > > + */
> > > +int init_pcpu_list_head(struct pcpu_list_head **ppcpu_head)
> > > +{
> > > +	struct pcpu_list_head *pcpu_head = alloc_percpu(struct pcpu_list_head);
> > > +	int cpu;
> > > +
> > > +	if (!pcpu_head)
> > > +		return -ENOMEM;
> > > +
> > > +	for_each_possible_cpu(cpu) {
> > > +		struct pcpu_list_head *head = per_cpu_ptr(pcpu_head, cpu);
> > > +
> > > +		INIT_LIST_HEAD(&head->list);
> > > +		head->lock = __SPIN_LOCK_UNLOCKED(&head->lock);
> > > +		lockdep_set_class(&head->lock,&percpu_list_key);
> > > +	}
> > > +
> > > +	*ppcpu_head = pcpu_head;
> > > +	return 0;
> > > +}
> > The first time I looked at this patch, I had a hard time to figure out
> > which "struct pcpu_list_head" pointer is pointing to percpu data(the
> > pointer could be the parameter for per/this_cpu_ptr()), and which
> > pointer is pointing to actual structure. For example, 'pcpu_head' and
> > 'head' above are different types of pointers.
> > 
> > So besides improving my code reading skills, I think the following patch
> > helps ;-) Also it can resolve several splats of sparse when running
> > 'make C=1 lib/'.
> > 
> > Thoughts?
> 
> Yes, I think your patch is helpful. I will include your patch in my
> patchset.
> 

Given that a renaming will happen in the next version, carrying this as
a standalone patch will be a pain, I think. So feel free to squash this
into the patch #1, if that could make your job eariser ;-)

Regards,
Boqun

> Thanks,
> Longman
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-04-14 23:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 22:54 [PATCH v7 0/4] vfs: Use per-cpu list for SB's s_inodes list Waiman Long
2016-04-12 22:54 ` [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks Waiman Long
2016-04-13  2:09   ` Boqun Feng
2016-04-13 17:38     ` Waiman Long
2016-04-14 23:33       ` Boqun Feng [this message]
2016-04-15 17:14         ` Waiman Long
2016-04-13 15:03   ` Christoph Lameter
2016-04-13 17:47     ` Waiman Long
2016-04-13 18:03       ` Christoph Lameter
2016-04-14 14:10   ` Jan Kara
2016-04-14 18:48     ` Waiman Long
2016-04-12 22:54 ` [PATCH v7 2/4] fsnotify: Simplify inode iteration on umount Waiman Long
2016-04-12 22:54 ` [PATCH v7 3/4] vfs: Remove unnecessary list_for_each_entry_safe() variants Waiman Long
2016-04-12 22:54 ` [PATCH v7 4/4] vfs: Use per-cpu list for superblock's inode list Waiman Long
2016-04-14 14:20   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160414233334.GA21026@fixme-laptop.cn.ibm.com \
    --to=boqun.feng@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=bfields@fieldses.org \
    --cc=cl@linux-foundation.org \
    --cc=dchinner@redhat.com \
    --cc=doug.hatch@hpe.com \
    --cc=jack@suse.com \
    --cc=jlayton@poochiereds.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=scott.norton@hpe.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=waiman.long@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox