aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2025-05-12 11:27:34 +0200
committerPaolo Abeni <pabeni@redhat.com>2025-05-15 15:23:31 +0200
commitaaaaa6639cf56eac4c5e58981e7d1b279ba9f4c9 (patch)
tree23f77e0991844066313c70164ca4c967481ef73a
parentmptcp: Use nested-BH locking for hmac_storage (diff)
downloadwireguard-linux-aaaaa6639cf56eac4c5e58981e7d1b279ba9f4c9.tar.xz
wireguard-linux-aaaaa6639cf56eac4c5e58981e7d1b279ba9f4c9.zip
rds: Disable only bottom halves in rds_page_remainder_alloc()
rds_page_remainder_alloc() is invoked from a preemptible context or a tasklet. There is no need to disable interrupts for locking. Use local_bh_disable() instead of local_irq_save() for locking. Cc: Allison Henderson <allison.henderson@oracle.com> Cc: linux-rdma@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://patch.msgid.link/20250512092736.229935-14-bigeasy@linutronix.de Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to '')
-rw-r--r--net/rds/page.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/rds/page.c b/net/rds/page.c
index 7cc57e098ddb..e0dd4f62ea47 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -69,7 +69,6 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
gfp_t gfp)
{
struct rds_page_remainder *rem;
- unsigned long flags;
struct page *page;
int ret;
@@ -88,7 +87,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
}
rem = &per_cpu(rds_page_remainders, get_cpu());
- local_irq_save(flags);
+ local_bh_disable();
while (1) {
/* avoid a tiny region getting stuck by tossing it */
@@ -116,13 +115,13 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
}
/* alloc if there is nothing for us to use */
- local_irq_restore(flags);
+ local_bh_enable();
put_cpu();
page = alloc_page(gfp);
rem = &per_cpu(rds_page_remainders, get_cpu());
- local_irq_save(flags);
+ local_bh_disable();
if (!page) {
ret = -ENOMEM;
@@ -140,7 +139,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
rem->r_offset = 0;
}
- local_irq_restore(flags);
+ local_bh_enable();
put_cpu();
out:
rdsdebug("bytes %lu ret %d %p %u %u\n", bytes, ret,