Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Aring and committed by
David Teigland
455597a5 98808644

+4 -8
-2
fs/dlm/lock.c
··· 1206 1206 INIT_LIST_HEAD(&lkb->lkb_ownqueue); 1207 1207 INIT_LIST_HEAD(&lkb->lkb_rsb_lookup); 1208 1208 1209 - idr_preload(GFP_NOFS); 1210 1209 spin_lock(&ls->ls_lkbidr_spin); 1211 1210 rv = idr_alloc(&ls->ls_lkbidr, lkb, start, end, GFP_NOWAIT); 1212 1211 if (rv >= 0) 1213 1212 lkb->lkb_id = rv; 1214 1213 spin_unlock(&ls->ls_lkbidr_spin); 1215 - idr_preload_end(); 1216 1214 1217 1215 if (rv < 0) { 1218 1216 log_error(ls, "create_lkb idr error %d", rv);
+3 -3
fs/dlm/memory.c
··· 84 84 { 85 85 char *p; 86 86 87 - p = kzalloc(ls->ls_lvblen, GFP_NOFS); 87 + p = kzalloc(ls->ls_lvblen, GFP_ATOMIC); 88 88 return p; 89 89 } 90 90 ··· 97 97 { 98 98 struct dlm_rsb *r; 99 99 100 - r = kmem_cache_zalloc(rsb_cache, GFP_NOFS); 100 + r = kmem_cache_zalloc(rsb_cache, GFP_ATOMIC); 101 101 return r; 102 102 } 103 103 ··· 112 112 { 113 113 struct dlm_lkb *lkb; 114 114 115 - lkb = kmem_cache_zalloc(lkb_cache, GFP_NOFS); 115 + lkb = kmem_cache_zalloc(lkb_cache, GFP_ATOMIC); 116 116 return lkb; 117 117 } 118 118
-2
fs/dlm/recover.c
··· 310 310 struct dlm_ls *ls = r->res_ls; 311 311 int rv; 312 312 313 - idr_preload(GFP_NOFS); 314 313 spin_lock(&ls->ls_recover_idr_lock); 315 314 if (r->res_id) { 316 315 rv = -1; ··· 325 326 rv = 0; 326 327 out_unlock: 327 328 spin_unlock(&ls->ls_recover_idr_lock); 328 - idr_preload_end(); 329 329 return rv; 330 330 } 331 331
+1 -1
fs/dlm/requestqueue.c
··· 37 37 int length = le16_to_cpu(ms->m_header.h_length) - 38 38 sizeof(struct dlm_message); 39 39 40 - e = kmalloc(sizeof(struct rq_entry) + length, GFP_NOFS); 40 + e = kmalloc(sizeof(struct rq_entry) + length, GFP_ATOMIC); 41 41 if (!e) { 42 42 log_print("dlm_add_requestqueue: out of memory len %d", length); 43 43 return;