[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <558C2C29.7040106@sr71.net>
Date: Thu, 25 Jun 2015 09:28:25 -0700
From: Dave Hansen <dave@...1.net>
To: Eric Paris <eparis@...hat.com>
CC: dave.hansen@...ux.intel.com, akpm@...ux-foundation.org,
jack@...e.cz, viro@...iv.linux.org.uk, john@...nmccutchan.com,
rlove@...ve.org, tim.c.chen@...ux.intel.com, ak@...ux.intel.com,
linux-kernel@...r.kernel.org
Subject: Re: [RFCv2][PATCH 1/7] fs: optimize inotify/fsnotify code for unwatched
files
On 06/24/2015 05:57 PM, Eric Paris wrote:
> On Wed, 2015-06-24 at 17:16 -0700, Dave Hansen wrote:
>> + if (!to_tell->i_fsnotify_marks.first &&
>> + (!mnt || !mnt->mnt_fsnotify_marks.first))
>> + return 0;
>
> two useless peeps from the old peanut gallery of long lost....
>
> 1) should you actually move this check up before the IN_MODIFY check?
> This seems like it would be by far the most common case, and you'd save
> yourself a bunch of useless conditionals/bit operations.
Doing that actually makes fsnotify() 82 bytes smaller for me. I think
you're also right that the new check is a much more general condition
than the existing one. I'll move it up when I post again.
> 2) do you want to use hlist_empty(&to_tell->i_fsnotify_marks) instead,
> for readability (and they are static inline, so compiled code is the
> same)
Yeah I guess that makes sense. The only thing that the current code is
nice for is that it makes it obvious that the .first checks match with
the srcu_dereference()s done below.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists