diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 2 | ||||
-rw-r--r-- | mm/fremap.c | 2 | ||||
-rw-r--r-- | mm/huge_memory.c | 1 | ||||
-rw-r--r-- | mm/mempolicy.c | 5 | ||||
-rw-r--r-- | mm/slob.c | 6 |
5 files changed, 8 insertions, 8 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 2c4ce17651d8..9eef55838fca 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -346,7 +346,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, | |||
346 | * pages requested were isolated. If there were any failures, 0 is | 346 | * pages requested were isolated. If there were any failures, 0 is |
347 | * returned and CMA will fail. | 347 | * returned and CMA will fail. |
348 | */ | 348 | */ |
349 | if (strict && nr_strict_required != total_isolated) | 349 | if (strict && nr_strict_required > total_isolated) |
350 | total_isolated = 0; | 350 | total_isolated = 0; |
351 | 351 | ||
352 | if (locked) | 352 | if (locked) |
diff --git a/mm/fremap.c b/mm/fremap.c index 3899a86851ce..a0aaf0e56800 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -169,7 +169,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
169 | if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR)) | 169 | if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR)) |
170 | goto out; | 170 | goto out; |
171 | 171 | ||
172 | if (!vma->vm_ops->remap_pages) | 172 | if (!vma->vm_ops || !vma->vm_ops->remap_pages) |
173 | goto out; | 173 | goto out; |
174 | 174 | ||
175 | if (start < vma->vm_start || start + size > vma->vm_end) | 175 | if (start < vma->vm_start || start + size > vma->vm_end) |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index a863af26c79c..40f17c34b415 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/khugepaged.h> | 17 | #include <linux/khugepaged.h> |
18 | #include <linux/freezer.h> | 18 | #include <linux/freezer.h> |
19 | #include <linux/mman.h> | 19 | #include <linux/mman.h> |
20 | #include <linux/pagemap.h> | ||
20 | #include <asm/tlb.h> | 21 | #include <asm/tlb.h> |
21 | #include <asm/pgalloc.h> | 22 | #include <asm/pgalloc.h> |
22 | #include "internal.h" | 23 | #include "internal.h" |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0b78fb9ea65b..d04a8a54c294 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1536,9 +1536,8 @@ asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len, | |||
1536 | * | 1536 | * |
1537 | * Returns effective policy for a VMA at specified address. | 1537 | * Returns effective policy for a VMA at specified address. |
1538 | * Falls back to @task or system default policy, as necessary. | 1538 | * Falls back to @task or system default policy, as necessary. |
1539 | * Current or other task's task mempolicy and non-shared vma policies | 1539 | * Current or other task's task mempolicy and non-shared vma policies must be |
1540 | * are protected by the task's mmap_sem, which must be held for read by | 1540 | * protected by task_lock(task) by the caller. |
1541 | * the caller. | ||
1542 | * Shared policies [those marked as MPOL_F_SHARED] require an extra reference | 1541 | * Shared policies [those marked as MPOL_F_SHARED] require an extra reference |
1543 | * count--added by the get_policy() vm_op, as appropriate--to protect against | 1542 | * count--added by the get_policy() vm_op, as appropriate--to protect against |
1544 | * freeing by another task. It is the caller's responsibility to free the | 1543 | * freeing by another task. It is the caller's responsibility to free the |
@@ -429,7 +429,7 @@ static __always_inline void * | |||
429 | __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) | 429 | __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) |
430 | { | 430 | { |
431 | unsigned int *m; | 431 | unsigned int *m; |
432 | int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); | 432 | int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); |
433 | void *ret; | 433 | void *ret; |
434 | 434 | ||
435 | gfp &= gfp_allowed_mask; | 435 | gfp &= gfp_allowed_mask; |
@@ -502,7 +502,7 @@ void kfree(const void *block) | |||
502 | 502 | ||
503 | sp = virt_to_page(block); | 503 | sp = virt_to_page(block); |
504 | if (PageSlab(sp)) { | 504 | if (PageSlab(sp)) { |
505 | int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); | 505 | int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); |
506 | unsigned int *m = (unsigned int *)(block - align); | 506 | unsigned int *m = (unsigned int *)(block - align); |
507 | slob_free(m, *m + align); | 507 | slob_free(m, *m + align); |
508 | } else | 508 | } else |
@@ -521,7 +521,7 @@ size_t ksize(const void *block) | |||
521 | 521 | ||
522 | sp = virt_to_page(block); | 522 | sp = virt_to_page(block); |
523 | if (PageSlab(sp)) { | 523 | if (PageSlab(sp)) { |
524 | int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); | 524 | int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); |
525 | unsigned int *m = (unsigned int *)(block - align); | 525 | unsigned int *m = (unsigned int *)(block - align); |
526 | return SLOB_UNITS(*m) * SLOB_UNIT; | 526 | return SLOB_UNITS(*m) * SLOB_UNIT; |
527 | } else | 527 | } else |