linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hpe.com>
To: Dave Chinner <david@fromorbit.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@hp.com>,
	Douglas Hatch <doug.hatch@hp.com>
Subject: Re: [PATCH v2 3/3] vfs: Use per-cpu list for superblock's inode list
Date: Tue, 23 Feb 2016 13:56:33 -0500	[thread overview]
Message-ID: <56CCAB61.20206@hpe.com> (raw)
In-Reply-To: <20160221213419.GB25832@dastard>

On 02/21/2016 04:34 PM, Dave Chinner wrote:
> On Fri, Feb 19, 2016 at 04:10:45PM -0500, Waiman Long wrote:
>> +/*
>> + * Superblock's inode list iterator function and arguments macros
>> + */
>> +#define SB_INODES_ITER_FUNC(name, lock, struct_fields)			\
>> +	struct name ## _arg {						\
>> +		struct_fields;						\
>> +	};								\
>> +	static int name ## _iter(struct pcpu_list_node *_node,		\
>> +				 struct pcpu_list_node **_pnext,	\
>> +				 spinlock_t *lock, void *_arg)
>> +
>> +#define SB_INODES_ITER_ARGS(name, i, a)					\
>> +	struct inode *i = container_of(_node, struct inode, i_sb_list);	\
>> +	struct name ## _arg *a = (struct name ## _arg *)_arg
>> +
>> +#define SB_INODES_ITER_ARGS_SAFE(name, i, n, a)				\
>> +	struct inode *i = container_of(_node, struct inode, i_sb_list);	\
>> +	struct inode *n = container_of(*_pnext, struct inode, i_sb_list);\
>> +	struct name ## _arg *a = (struct name ## _arg *)_arg
>> +
>> +#define SB_INODES_ITER_SET_PCPU_LIST_NEXT(n)				\
>> +	{ *_pnext =&(n)->i_sb_list; }
>> +
>> +#define SB_INODES_ITER_CALL(name, sb)					\
>> +	pcpu_list_iterate(sb->s_inodes, false, NULL, name ## _iter,&arg)
>> +
>> +#define SB_INODES_ITER_CALL_SAFE(name, sb, phead)			\
>> +	pcpu_list_iterate(sb->s_inodes, true, phead, name ## _iter,&arg)
>> +
> No, just no.
>
> Ungreppable, breaks cscope, obfuscates everything, shouts a lot,
> code using the API looks completely broken (e.g. semi-colons in
> "function declarations"), and it reminds me of the worst of the
> worst unmaintainable code in an exceedingly buggy and undebuggable
> proprietary filesystem I've previously had the "joy" of working
> with.
>
> Just fix the bug in the previous version; it's so much cleaner than
> this .... mess.
>
> Cheers,
>
> Dave.

Sorry for that. I will scrap the current approach and use another way to 
iterate the list instead. I will send out an updated patch soon.

Cheers,
Longman

      parent reply	other threads:[~2016-02-23 18:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 21:10 [PATCH v2 0/3] vfs: Use per-cpu list for SB's s_inodes list Waiman Long
2016-02-19 21:10 ` [PATCH v2 1/3] lib/percpu-list: Per-cpu list with associated per-cpu locks Waiman Long
2016-02-19 21:10 ` [PATCH v2 2/3] vfs: Refactor sb->s_inodes iteration functions Waiman Long
2016-02-19 21:10 ` [PATCH v2 3/3] vfs: Use per-cpu list for superblock's inode list Waiman Long
2016-02-21 21:34   ` Dave Chinner
2016-02-22  9:18     ` Peter Zijlstra
2016-02-22 11:54       ` Jan Kara
2016-02-22 12:12         ` Peter Zijlstra
2016-02-22 13:04           ` Jan Kara
2016-02-22 21:08             ` Dave Chinner
2016-02-22 22:18               ` Jan Kara
2016-02-23 19:01             ` Waiman Long
2016-02-23 18:56     ` Waiman Long [this message]

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=56CCAB61.20206@hpe.com \
    --to=waiman.long@hpe.com \
    --cc=andi@firstfloor.org \
    --cc=bfields@fieldses.org \
    --cc=cl@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=doug.hatch@hp.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@hp.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).