Skip to content

Commit 455597a

Browse files
Alexander Aringteigland
authored andcommitted
dlm: switch to GFP_ATOMIC in dlm allocations
Replace GFP_NOFS with GFP_ATOMIC. Also stop using idr_preload which uses a non-bh spin_lock. This is further preparation for softirq message processing. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 9880864 commit 455597a

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

fs/dlm/lock.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,13 +1206,11 @@ static int _create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret,
12061206
INIT_LIST_HEAD(&lkb->lkb_ownqueue);
12071207
INIT_LIST_HEAD(&lkb->lkb_rsb_lookup);
12081208

1209-
idr_preload(GFP_NOFS);
12101209
spin_lock(&ls->ls_lkbidr_spin);
12111210
rv = idr_alloc(&ls->ls_lkbidr, lkb, start, end, GFP_NOWAIT);
12121211
if (rv >= 0)
12131212
lkb->lkb_id = rv;
12141213
spin_unlock(&ls->ls_lkbidr_spin);
1215-
idr_preload_end();
12161214

12171215
if (rv < 0) {
12181216
log_error(ls, "create_lkb idr error %d", rv);

fs/dlm/memory.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ char *dlm_allocate_lvb(struct dlm_ls *ls)
8484
{
8585
char *p;
8686

87-
p = kzalloc(ls->ls_lvblen, GFP_NOFS);
87+
p = kzalloc(ls->ls_lvblen, GFP_ATOMIC);
8888
return p;
8989
}
9090

@@ -97,7 +97,7 @@ struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls)
9797
{
9898
struct dlm_rsb *r;
9999

100-
r = kmem_cache_zalloc(rsb_cache, GFP_NOFS);
100+
r = kmem_cache_zalloc(rsb_cache, GFP_ATOMIC);
101101
return r;
102102
}
103103

@@ -112,7 +112,7 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls)
112112
{
113113
struct dlm_lkb *lkb;
114114

115-
lkb = kmem_cache_zalloc(lkb_cache, GFP_NOFS);
115+
lkb = kmem_cache_zalloc(lkb_cache, GFP_ATOMIC);
116116
return lkb;
117117
}
118118

fs/dlm/recover.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ static int recover_idr_add(struct dlm_rsb *r)
310310
struct dlm_ls *ls = r->res_ls;
311311
int rv;
312312

313-
idr_preload(GFP_NOFS);
314313
spin_lock(&ls->ls_recover_idr_lock);
315314
if (r->res_id) {
316315
rv = -1;
@@ -326,7 +325,6 @@ static int recover_idr_add(struct dlm_rsb *r)
326325
rv = 0;
327326
out_unlock:
328327
spin_unlock(&ls->ls_recover_idr_lock);
329-
idr_preload_end();
330328
return rv;
331329
}
332330

fs/dlm/requestqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void dlm_add_requestqueue(struct dlm_ls *ls, int nodeid,
3737
int length = le16_to_cpu(ms->m_header.h_length) -
3838
sizeof(struct dlm_message);
3939

40-
e = kmalloc(sizeof(struct rq_entry) + length, GFP_NOFS);
40+
e = kmalloc(sizeof(struct rq_entry) + length, GFP_ATOMIC);
4141
if (!e) {
4242
log_print("dlm_add_requestqueue: out of memory len %d", length);
4343
return;

0 commit comments

Comments
 (0)