From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
stable@vger.kernel.org, Sasha Levin <sashal@kernel.org>,
Jeff Layton <jlayton@kernel.org>, NeilBrown <neilb@suse.de>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
Hughdan Liu <hughliu@amazon.com>
Subject: Re: [PATCH 5.10.y] nfsd: Don't call freezable_schedule_timeout() after each successful page allocation in svc_alloc_arg().
Date: Tue, 27 Aug 2024 14:48:33 +0200 [thread overview]
Message-ID: <2024082726-switch-barricade-8c4a@gregkh> (raw)
In-Reply-To: <ZsOKuAYNaW0CGqnA@tissot.1015granger.net>
On Mon, Aug 19, 2024 at 02:11:04PM -0400, Chuck Lever wrote:
> On Mon, Aug 19, 2024 at 10:05:51AM -0700, Kuniyuki Iwashima wrote:
> > When commit 390390240145 ("nfsd: don't allow nfsd threads to be
> > signalled.") is backported to 5.10, it was adjusted considering commit
> > 3feac2b55293 ("sunrpc: exclude from freezer when waiting for requests:").
> >
> > However, 3feac2b55293 is based on commit f6e70aab9dfe ("SUNRPC: refresh
> > rq_pages using a bulk page allocator"), which converted page-by-page
> > allocation to a batch allocation, so schedule_timeout() is placed
> > un-nested.
> >
> > As a result, the backported commit 7229200f6866 ("nfsd: don't allow nfsd
> > threads to be signalled.") placed freezable_schedule_timeout() in the wrong
> > place.
> >
> > Now, freezable_schedule_timeout() is called after every successful page
> > allocation, and we see 30%+ performance regression on 5.10.220 in our
> > test suite.
> >
> > Let's move it to the correct place so that freezable_schedule_timeout()
> > is called only when page allocation fails.
> >
> > Fixes: 7229200f6866 ("nfsd: don't allow nfsd threads to be signalled.")
> > Reported-by: Hughdan Liu <hughliu@amazon.com>
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> > ---
> > net/sunrpc/svc_xprt.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> > index d1eacf3358b8..60782504ad3e 100644
> > --- a/net/sunrpc/svc_xprt.c
> > +++ b/net/sunrpc/svc_xprt.c
> > @@ -679,8 +679,8 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
> > set_current_state(TASK_RUNNING);
> > return -EINTR;
> > }
> > + freezable_schedule_timeout(msecs_to_jiffies(500));
> > }
> > - freezable_schedule_timeout(msecs_to_jiffies(500));
> > rqstp->rq_pages[i] = p;
> > }
> > rqstp->rq_page_end = &rqstp->rq_pages[i];
> > --
> > 2.30.2
> >
>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2024-08-27 12:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 17:05 [PATCH 5.10.y] nfsd: Don't call freezable_schedule_timeout() after each successful page allocation in svc_alloc_arg() Kuniyuki Iwashima
2024-08-19 18:11 ` Chuck Lever
2024-08-27 12:48 ` Greg Kroah-Hartman [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=2024082726-switch-barricade-8c4a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=chuck.lever@oracle.com \
--cc=hughliu@amazon.com \
--cc=jlayton@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@amazon.com \
--cc=neilb@suse.de \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/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