Skip to content

Commit 53061af

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "4 fixes" * emailed patches from Andrew Morton <[email protected]>: mem-hotplug: use nodes that contain memory as mask in new_node_page() scripts/recordmcount.c: account for .softirqentry.text dma-mapping.h: preserve unmap info for CONFIG_DMA_API_DEBUG mm,ksm: fix endless looping in allocating memory when ksm enable
2 parents ae6dd8d + 231e97e commit 53061af

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

include/linux/dma-mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static inline int dma_mmap_wc(struct device *dev,
718718
#define dma_mmap_writecombine dma_mmap_wc
719719
#endif
720720

721-
#ifdef CONFIG_NEED_DMA_MAP_STATE
721+
#if defined(CONFIG_NEED_DMA_MAP_STATE) || defined(CONFIG_DMA_API_DEBUG)
722722
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
723723
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
724724
#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)

mm/ksm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ static inline struct rmap_item *alloc_rmap_item(void)
283283
{
284284
struct rmap_item *rmap_item;
285285

286-
rmap_item = kmem_cache_zalloc(rmap_item_cache, GFP_KERNEL);
286+
rmap_item = kmem_cache_zalloc(rmap_item_cache, GFP_KERNEL |
287+
__GFP_NORETRY | __GFP_NOWARN);
287288
if (rmap_item)
288289
ksm_rmap_items++;
289290
return rmap_item;

mm/memory_hotplug.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,8 @@ static struct page *new_node_page(struct page *page, unsigned long private,
15551555
{
15561556
gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE;
15571557
int nid = page_to_nid(page);
1558-
nodemask_t nmask = node_online_map;
1559-
struct page *new_page;
1558+
nodemask_t nmask = node_states[N_MEMORY];
1559+
struct page *new_page = NULL;
15601560

15611561
/*
15621562
* TODO: allocate a destination hugepage from a nearest neighbor node,
@@ -1567,14 +1567,14 @@ static struct page *new_node_page(struct page *page, unsigned long private,
15671567
return alloc_huge_page_node(page_hstate(compound_head(page)),
15681568
next_node_in(nid, nmask));
15691569

1570-
if (nid != next_node_in(nid, nmask))
1571-
node_clear(nid, nmask);
1570+
node_clear(nid, nmask);
15721571

15731572
if (PageHighMem(page)
15741573
|| (zone_idx(page_zone(page)) == ZONE_MOVABLE))
15751574
gfp_mask |= __GFP_HIGHMEM;
15761575

1577-
new_page = __alloc_pages_nodemask(gfp_mask, 0,
1576+
if (!nodes_empty(nmask))
1577+
new_page = __alloc_pages_nodemask(gfp_mask, 0,
15781578
node_zonelist(nid, gfp_mask), &nmask);
15791579
if (!new_page)
15801580
new_page = __alloc_pages(gfp_mask, 0,

scripts/recordmcount.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ is_mcounted_section_name(char const *const txtname)
363363
strcmp(".sched.text", txtname) == 0 ||
364364
strcmp(".spinlock.text", txtname) == 0 ||
365365
strcmp(".irqentry.text", txtname) == 0 ||
366+
strcmp(".softirqentry.text", txtname) == 0 ||
366367
strcmp(".kprobes.text", txtname) == 0 ||
367368
strcmp(".text.unlikely", txtname) == 0;
368369
}

scripts/recordmcount.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
".sched.text" => 1,
135135
".spinlock.text" => 1,
136136
".irqentry.text" => 1,
137+
".softirqentry.text" => 1,
137138
".kprobes.text" => 1,
138139
".text.unlikely" => 1,
139140
);

0 commit comments

Comments
 (0)