All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@aol.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Gao Xiang <gaoxiang25@huawei.com>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Eric Biggers <ebiggers@kernel.org>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <yuchao0@huawei.com>,
	Tyler Hicks <tyhicks@canonical.com>,
	linux-fsdevel@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-fscrypt@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup
Date: Wed, 11 Dec 2019 22:41:00 +0800	[thread overview]
Message-ID: <20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1> (raw)
In-Reply-To: <20191211134014.GM32169@bombadil.infradead.org>

Hi Matthew,

On Wed, Dec 11, 2019 at 05:40:14AM -0800, Matthew Wilcox wrote:
> On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote:
> > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len)
> > > {
> > >         if (len >= 1 && unlikely(name[0] == '.')) {
> > 
> > 
> > And I suggest drop "unlikely" here since files start with prefix
> > '.' (plus specical ".", "..") are not as uncommon as you expected...
> 
> They absolutely are uncommon.  Even if you just consider
> /home/willy/kernel/linux/.git/config, only one of those six path elements
> starts with a '.'.

Okay, I think it depends on userdata and access patterns.
I admit I have no statistics on all those callers.

Just considering introducing an inline helper for cleanup, except for
lookup_one_len_common() (since it's on an error path), others were all
without unlikely() before.

Ignore my words if it seems unreasonable or unlikely() is an improvement
in this patch and sorry for annoying.

Thanks,
Gao Xiang


WARNING: multiple messages have this Message-ID (diff)
From: Gao Xiang via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Matthew Wilcox <willy@infradead.org>
Cc: ecryptfs@vger.kernel.org, "Theodore Y. Ts'o" <tytso@mit.edu>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-kernel@vger.kernel.org, Tyler Hicks <tyhicks@canonical.com>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-fscrypt@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup
Date: Wed, 11 Dec 2019 22:41:00 +0800	[thread overview]
Message-ID: <20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1> (raw)
In-Reply-To: <20191211134014.GM32169@bombadil.infradead.org>

Hi Matthew,

On Wed, Dec 11, 2019 at 05:40:14AM -0800, Matthew Wilcox wrote:
> On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote:
> > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len)
> > > {
> > >         if (len >= 1 && unlikely(name[0] == '.')) {
> > 
> > 
> > And I suggest drop "unlikely" here since files start with prefix
> > '.' (plus specical ".", "..") are not as uncommon as you expected...
> 
> They absolutely are uncommon.  Even if you just consider
> /home/willy/kernel/linux/.git/config, only one of those six path elements
> starts with a '.'.

Okay, I think it depends on userdata and access patterns.
I admit I have no statistics on all those callers.

Just considering introducing an inline helper for cleanup, except for
lookup_one_len_common() (since it's on an error path), others were all
without unlikely() before.

Ignore my words if it seems unreasonable or unlikely() is an improvement
in this patch and sorry for annoying.

Thanks,
Gao Xiang



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2019-12-11 14:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  2:20 [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup Tiezhu Yang
2019-12-11  2:20 ` [f2fs-dev] " Tiezhu Yang
2019-12-11  2:48 ` Eric Biggers
2019-12-11  2:48   ` [f2fs-dev] " Eric Biggers
2019-12-11  3:59   ` Tiezhu Yang
2019-12-11  3:59     ` [f2fs-dev] " Tiezhu Yang
2019-12-11  4:47     ` Al Viro
2019-12-11  4:47       ` [f2fs-dev] " Al Viro
2019-12-11  6:38       ` Tiezhu Yang
2019-12-11  6:38         ` Tiezhu Yang
2019-12-11  6:38         ` [f2fs-dev] " Tiezhu Yang
2019-12-11  7:17         ` Gao Xiang
2019-12-11  7:17           ` Gao Xiang
2019-12-11  7:17           ` [f2fs-dev] " Gao Xiang
2019-12-11 13:40           ` Matthew Wilcox
2019-12-11 13:40             ` [f2fs-dev] " Matthew Wilcox
2019-12-11 14:41             ` Gao Xiang [this message]
2019-12-11 14:41               ` Gao Xiang via Linux-f2fs-devel

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=20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1 \
    --to=hsiangkao@aol.com \
    --cc=darrick.wong@oracle.com \
    --cc=ebiggers@kernel.org \
    --cc=ecryptfs@vger.kernel.org \
    --cc=gaoxiang25@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tyhicks@canonical.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=yuchao0@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.