Skip to content

Commit aaaaa66

Browse files
Sebastian Andrzej SiewiorPaolo Abeni
authored andcommitted
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 <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 82d9e6b commit aaaaa66

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

net/rds/page.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
6969
gfp_t gfp)
7070
{
7171
struct rds_page_remainder *rem;
72-
unsigned long flags;
7372
struct page *page;
7473
int ret;
7574

@@ -88,7 +87,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
8887
}
8988

9089
rem = &per_cpu(rds_page_remainders, get_cpu());
91-
local_irq_save(flags);
90+
local_bh_disable();
9291

9392
while (1) {
9493
/* avoid a tiny region getting stuck by tossing it */
@@ -116,13 +115,13 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
116115
}
117116

118117
/* alloc if there is nothing for us to use */
119-
local_irq_restore(flags);
118+
local_bh_enable();
120119
put_cpu();
121120

122121
page = alloc_page(gfp);
123122

124123
rem = &per_cpu(rds_page_remainders, get_cpu());
125-
local_irq_save(flags);
124+
local_bh_disable();
126125

127126
if (!page) {
128127
ret = -ENOMEM;
@@ -140,7 +139,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
140139
rem->r_offset = 0;
141140
}
142141

143-
local_irq_restore(flags);
142+
local_bh_enable();
144143
put_cpu();
145144
out:
146145
rdsdebug("bytes %lu ret %d %p %u %u\n", bytes, ret,

0 commit comments

Comments
 (0)