Skip to content

Commit 88dca4c

Browse files
Christoph Hellwigtorvalds
authored andcommitted
mm: remove the pgprot argument to __vmalloc
The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Michael Kelley <mikelley@microsoft.com> [hyperv] Acked-by: Gao Xiang <xiang@kernel.org> [erofs] Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Wei Liu <wei.liu@kernel.org> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Airlie <airlied@linux.ie> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Laura Abbott <labbott@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Robin Murphy <robin.murphy@arm.com> Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will@kernel.org> Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d28ff99 commit 88dca4c

29 files changed

Lines changed: 47 additions & 59 deletions

File tree

‎arch/x86/hyperv/hv_init.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ static int hv_cpu_init(unsigned int cpu)
9797
* not be stopped in the case of CPU offlining and the VM will hang.
9898
*/
9999
if (!*hvp) {
100-
*hvp = __vmalloc(PAGE_SIZE, GFP_KERNEL | __GFP_ZERO,
101-
PAGE_KERNEL);
100+
*hvp = __vmalloc(PAGE_SIZE, GFP_KERNEL | __GFP_ZERO);
102101
}
103102

104103
if (*hvp) {

‎arch/x86/include/asm/kvm_host.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,8 +1279,7 @@ extern struct kmem_cache *x86_fpu_cache;
12791279
#define __KVM_HAVE_ARCH_VM_ALLOC
12801280
static inline struct kvm *kvm_arch_alloc_vm(void)
12811281
{
1282-
return __vmalloc(kvm_x86_ops.vm_size,
1283-
GFP_KERNEL_ACCOUNT | __GFP_ZERO, PAGE_KERNEL);
1282+
return __vmalloc(kvm_x86_ops.vm_size, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
12841283
}
12851284
void kvm_arch_free_vm(struct kvm *kvm);
12861285

‎arch/x86/kvm/svm/sev.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,
336336
/* Avoid using vmalloc for smaller buffers. */
337337
size = npages * sizeof(struct page *);
338338
if (size > PAGE_SIZE)
339-
pages = __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_ZERO,
340-
PAGE_KERNEL);
339+
pages = __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
341340
else
342341
pages = kmalloc(size, GFP_KERNEL_ACCOUNT);
343342

‎drivers/block/drbd/drbd_bitmap.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
396396
bytes = sizeof(struct page *)*want;
397397
new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
398398
if (!new_pages) {
399-
new_pages = __vmalloc(bytes,
400-
GFP_NOIO | __GFP_ZERO,
401-
PAGE_KERNEL);
399+
new_pages = __vmalloc(bytes, GFP_NOIO | __GFP_ZERO);
402400
if (!new_pages)
403401
return NULL;
404402
}

‎drivers/gpu/drm/etnaviv/etnaviv_dump.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
154154
file_size += sizeof(*iter.hdr) * n_obj;
155155

156156
/* Allocate the file in vmalloc memory, it's likely to be big */
157-
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
158-
PAGE_KERNEL);
157+
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN |
158+
__GFP_NORETRY);
159159
if (!iter.start) {
160160
mutex_unlock(&gpu->mmu_context->lock);
161161
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");

‎drivers/lightnvm/pblk-init.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ static int pblk_l2p_init(struct pblk *pblk, bool factory_init)
145145
int ret = 0;
146146

147147
map_size = pblk_trans_map_size(pblk);
148-
pblk->trans_map = __vmalloc(map_size, GFP_KERNEL | __GFP_NOWARN
149-
| __GFP_RETRY_MAYFAIL | __GFP_HIGHMEM,
150-
PAGE_KERNEL);
148+
pblk->trans_map = __vmalloc(map_size, GFP_KERNEL | __GFP_NOWARN |
149+
__GFP_RETRY_MAYFAIL | __GFP_HIGHMEM);
151150
if (!pblk->trans_map) {
152151
pblk_err(pblk, "failed to allocate L2P (need %zu of memory)\n",
153152
map_size);

‎drivers/md/dm-bufio.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,13 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
400400
*/
401401
if (gfp_mask & __GFP_NORETRY) {
402402
unsigned noio_flag = memalloc_noio_save();
403-
void *ptr = __vmalloc(c->block_size, gfp_mask, PAGE_KERNEL);
403+
void *ptr = __vmalloc(c->block_size, gfp_mask);
404404

405405
memalloc_noio_restore(noio_flag);
406406
return ptr;
407407
}
408408

409-
return __vmalloc(c->block_size, gfp_mask, PAGE_KERNEL);
409+
return __vmalloc(c->block_size, gfp_mask);
410410
}
411411

412412
/*

‎drivers/mtd/ubi/io.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
12971297
if (!ubi_dbg_chk_io(ubi))
12981298
return 0;
12991299

1300-
buf1 = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
1300+
buf1 = __vmalloc(len, GFP_NOFS);
13011301
if (!buf1) {
13021302
ubi_err(ubi, "cannot allocate memory to check writes");
13031303
return 0;
@@ -1361,7 +1361,7 @@ int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
13611361
if (!ubi_dbg_chk_io(ubi))
13621362
return 0;
13631363

1364-
buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
1364+
buf = __vmalloc(len, GFP_NOFS);
13651365
if (!buf) {
13661366
ubi_err(ubi, "cannot allocate memory to check for 0xFFs");
13671367
return 0;

‎drivers/scsi/sd_zbc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ static void *sd_zbc_alloc_report_buffer(struct scsi_disk *sdkp,
136136

137137
while (bufsize >= SECTOR_SIZE) {
138138
buf = __vmalloc(bufsize,
139-
GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY,
140-
PAGE_KERNEL);
139+
GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY);
141140
if (buf) {
142141
*buflen = bufsize;
143142
return buf;

‎fs/gfs2/dir.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip)
354354

355355
hc = kmalloc(hsize, GFP_NOFS | __GFP_NOWARN);
356356
if (hc == NULL)
357-
hc = __vmalloc(hsize, GFP_NOFS, PAGE_KERNEL);
357+
hc = __vmalloc(hsize, GFP_NOFS);
358358

359359
if (hc == NULL)
360360
return ERR_PTR(-ENOMEM);
@@ -1166,7 +1166,7 @@ static int dir_double_exhash(struct gfs2_inode *dip)
11661166

11671167
hc2 = kmalloc_array(hsize_bytes, 2, GFP_NOFS | __GFP_NOWARN);
11681168
if (hc2 == NULL)
1169-
hc2 = __vmalloc(hsize_bytes * 2, GFP_NOFS, PAGE_KERNEL);
1169+
hc2 = __vmalloc(hsize_bytes * 2, GFP_NOFS);
11701170

11711171
if (!hc2)
11721172
return -ENOMEM;
@@ -1327,7 +1327,7 @@ static void *gfs2_alloc_sort_buffer(unsigned size)
13271327
if (size < KMALLOC_MAX_SIZE)
13281328
ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN);
13291329
if (!ptr)
1330-
ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL);
1330+
ptr = __vmalloc(size, GFP_NOFS);
13311331
return ptr;
13321332
}
13331333

@@ -1987,8 +1987,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
19871987

19881988
ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN);
19891989
if (ht == NULL)
1990-
ht = __vmalloc(size, GFP_NOFS | __GFP_NOWARN | __GFP_ZERO,
1991-
PAGE_KERNEL);
1990+
ht = __vmalloc(size, GFP_NOFS | __GFP_NOWARN | __GFP_ZERO);
19921991
if (!ht)
19931992
return -ENOMEM;
19941993

0 commit comments

Comments
 (0)