mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Roesch <shr@fb.com>
To: Christian Brauner <brauner@kernel.org>,
	Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>,
	"Darrick J. Wong" <djwong@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, lkp@lists.01.org, lkp@intel.com,
	ying.huang@intel.com, feng.tang@intel.com,
	zhengjun.xing@linux.intel.com, fengwei.yin@intel.com,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [fs] faf99b5635: will-it-scale.per_thread_ops -9.0% regression
Date: Tue, 16 Aug 2022 11:35:44 +0200	[thread overview]
Message-ID: <16d100df-6d88-c7c5-9b1b-fea40ec40d96@fb.com> (raw)
In-Reply-To: <20220815100044.7j2u2yjlkanhkrfg@wittgenstein>


On 8/15/22 12:00 PM, Christian Brauner wrote:
> !-------------------------------------------------------------------|
>   This Message Is From an External Sender
> 
> |-------------------------------------------------------------------!
> 
> On Mon, Aug 15, 2022 at 12:32:25PM +0800, kernel test robot wrote:
>>
>>
>> Greeting,
>>
>> FYI, we noticed a -9.0% regression of will-it-scale.per_thread_ops due to commit:
>>
>>
>> commit: faf99b563558f74188b7ca34faae1c1da49a7261 ("fs: add __remove_file_privs() with flags parameter")
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> 
> This seems overall pretty odd tbh at least it's not immediately obvious
> how that specific commit would've caused this. But fwiw, I think there's
> one issue in this change which we originally overlooked which might
> explain this.
> 
> Before faf99b563558 ("fs: add __remove_file_privs() with flags
> parameter") inode_has_no_xattr() was called when
> dentry_needs_remove_privs() returned 0.
> 
> 	int error = 0
> 	[...]
> 	kill = dentry_needs_remove_privs(dentry);
> 	if (kill < 0)
> 		return kill;
> 	if (kill)
> 		error = __remove_privs(file_mnt_user_ns(file), dentry, kill);
> 	if (!error)
> 		inode_has_no_xattr(inode);
> 
> but now we do:
> 
> 	kill = dentry_needs_remove_privs(dentry);
> 	if (kill <= 0)
> 		return kill;
> 
> which means we don't call inode_has_no_xattr(). I don't think that we
> did this intentionally. inode_has_no_xattr() just sets S_NOSEC which
> means next time we call into __file_remove_privs() we can return earlier
> instead of hitting dentry_needs_remove_privs() again:
> 
> if (IS_NOSEC(inode) || !S_ISREG(inode->i_mode))
> 	return 0;
> 
> So I think that needs to be fixed?
> 

Christian,

thanks for looking into this. I'll prepare a fix to maintain the original behavior.

--Stefan

> Christian

      reply	other threads:[~2022-08-16 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15  4:32 kernel test robot
2022-08-15 10:00 ` Christian Brauner
2022-08-16  9:35   ` Stefan Roesch [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=16d100df-6d88-c7c5-9b1b-fea40ec40d96@fb.com \
    --to=shr@fb.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=feng.tang@intel.com \
    --cc=fengwei.yin@intel.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=oliver.sang@intel.com \
    --cc=ying.huang@intel.com \
    --cc=zhengjun.xing@linux.intel.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

all inboxes | Powered by JetHome®