Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346266
b: refs/heads/master
c: bc891c9
h: refs/heads/master
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Nov 9, 2012
1 parent 065a01a commit 851d70e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a506c13a4d1ec5e1f2f9bc0123dacb5d123004d3
refs/heads/master: bc891c9ae3fb2848922e0f0da22fd7de0d58dc1b
16 changes: 9 additions & 7 deletions trunk/drivers/block/drbd/drbd_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,16 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
return old_pages;

/* Trying kmalloc first, falling back to vmalloc.
* GFP_KERNEL is ok, as this is done when a lower level disk is
* "attached" to the drbd. Context is receiver thread or drbdsetup /
* netlink process. As we have no disk yet, we are not in the IO path,
* not even the IO path of the peer. */
* GFP_NOIO, as this is called while drbd IO is "suspended",
* and during resize or attach on diskless Primary,
* we must not block on IO to ourselves.
* Context is receiver thread or dmsetup. */
bytes = sizeof(struct page *)*want;
new_pages = kmalloc(bytes, GFP_KERNEL);
new_pages = kmalloc(bytes, GFP_NOIO);
if (!new_pages) {
new_pages = vmalloc(bytes);
new_pages = __vmalloc(bytes,
GFP_NOIO | __GFP_HIGHMEM,
PAGE_KERNEL);
if (!new_pages)
return NULL;
vmalloced = 1;
Expand All @@ -406,7 +408,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
for (i = 0; i < have; i++)
new_pages[i] = old_pages[i];
for (; i < want; i++) {
page = alloc_page(GFP_HIGHUSER);
page = alloc_page(GFP_NOIO | __GFP_HIGHMEM);
if (!page) {
bm_free_pages(new_pages + have, i - have);
bm_vk_free(new_pages, vmalloced);
Expand Down

0 comments on commit 851d70e

Please sign in to comment.