From 8a392ca0c5e24d2be38002dbdd49e369280f4d03 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 12 Jun 2024 16:46:44 +0200 Subject: [PATCH] 5.15-stable patches added patches: sunrpc-exclude-from-freezer-when-waiting-for-requests.patch --- queue-5.15/series | 1 + ...om-freezer-when-waiting-for-requests.patch | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 queue-5.15/sunrpc-exclude-from-freezer-when-waiting-for-requests.patch diff --git a/queue-5.15/series b/queue-5.15/series index 8c1394dde1d..2039643e954 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -349,3 +349,4 @@ vxlan-fix-regression-when-dropping-packets-due-to-invalid-src-addresses.patch net-dsa-sja1105-always-enable-the-incl_srcpt-option.patch net-dsa-tag_sja1105-always-prefer-source-port-information-from-incl_srcpt.patch scripts-gdb-fix-sb_-constants-parsing.patch +sunrpc-exclude-from-freezer-when-waiting-for-requests.patch diff --git a/queue-5.15/sunrpc-exclude-from-freezer-when-waiting-for-requests.patch b/queue-5.15/sunrpc-exclude-from-freezer-when-waiting-for-requests.patch new file mode 100644 index 00000000000..7324f3279ad --- /dev/null +++ b/queue-5.15/sunrpc-exclude-from-freezer-when-waiting-for-requests.patch @@ -0,0 +1,79 @@ +From cel@kernel.org Wed Jun 12 16:46:09 2024 +From: cel@kernel.org +Date: Fri, 7 Jun 2024 09:10:48 -0400 +Subject: sunrpc: exclude from freezer when waiting for requests: +To: , +Cc: NeilBrown , Jon Hunter +Message-ID: <20240607131048.8795-1-cel@kernel.org> + +From: NeilBrown + +Prior to v6.1, the freezer will only wake a kernel thread from an +uninterruptible sleep. Since we changed svc_get_next_xprt() to use and +IDLE sleep the freezer cannot wake it. We need to tell the freezer to +ignore it instead. + +To make this work with only upstream commits, 5.15.y would need +commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic") +which allows non-interruptible sleeps to be woken by the freezer. + +Fixes: 9b8a8e5e8129 ("nfsd: don't allow nfsd threads to be signalled.") +Tested-by: Jon Hunter +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfs/callback.c | 2 +- + fs/nfsd/nfs4proc.c | 3 ++- + net/sunrpc/svc_xprt.c | 4 ++-- + 3 files changed, 5 insertions(+), 4 deletions(-) + +--- a/fs/nfs/callback.c ++++ b/fs/nfs/callback.c +@@ -124,7 +124,7 @@ nfs41_callback_svc(void *vrqstp) + } else { + spin_unlock_bh(&serv->sv_cb_lock); + if (!kthread_should_stop()) +- schedule(); ++ freezable_schedule(); + finish_wait(&serv->sv_cb_waitq, &wq); + } + } +--- a/fs/nfsd/nfs4proc.c ++++ b/fs/nfsd/nfs4proc.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -1322,7 +1323,7 @@ try_again: + + /* allow 20secs for mount/unmount for now - revisit */ + if (kthread_should_stop() || +- (schedule_timeout(20*HZ) == 0)) { ++ (freezable_schedule_timeout(20*HZ) == 0)) { + finish_wait(&nn->nfsd_ssc_waitq, &wait); + kfree(work); + return nfserr_eagain; +--- a/net/sunrpc/svc_xprt.c ++++ b/net/sunrpc/svc_xprt.c +@@ -705,7 +705,7 @@ static int svc_alloc_arg(struct svc_rqst + set_current_state(TASK_RUNNING); + return -EINTR; + } +- schedule_timeout(msecs_to_jiffies(500)); ++ freezable_schedule_timeout(msecs_to_jiffies(500)); + } + rqstp->rq_page_end = &rqstp->rq_pages[pages]; + rqstp->rq_pages[pages] = NULL; /* this might be seen in nfsd_splice_actor() */ +@@ -765,7 +765,7 @@ static struct svc_xprt *svc_get_next_xpr + smp_mb__after_atomic(); + + if (likely(rqst_should_sleep(rqstp))) +- time_left = schedule_timeout(timeout); ++ time_left = freezable_schedule_timeout(timeout); + else + __set_current_state(TASK_RUNNING); + -- 2.47.3