2015-11-19 00:30:44

by David Rientjes

[permalink] [raw]
Subject: [patch -mm] mm, vmalloc: remove VM_VPAGES

VM_VPAGES is unnecessary, it's easier to check is_vmalloc_addr() when
reading /proc/vmallocinfo.

Signed-off-by: David Rientjes <[email protected]>
---
include/linux/vmalloc.h | 1 -
mm/vmalloc.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -14,7 +14,6 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */
#define VM_ALLOC 0x00000002 /* vmalloc() */
#define VM_MAP 0x00000004 /* vmap()ed pages */
#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
-#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
#define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
#define VM_NO_GUARD 0x00000040 /* don't add guard page */
#define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1591,7 +1591,6 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
if (array_size > PAGE_SIZE) {
pages = __vmalloc_node(array_size, 1, nested_gfp|__GFP_HIGHMEM,
PAGE_KERNEL, node, area->caller);
- area->flags |= VM_VPAGES;
} else {
pages = kmalloc_node(array_size, nested_gfp, node);
}
@@ -2649,7 +2648,7 @@ static int s_show(struct seq_file *m, void *p)
if (v->flags & VM_USERMAP)
seq_puts(m, " user");

- if (v->flags & VM_VPAGES)
+ if (is_vmalloc_addr(v->pages))
seq_puts(m, " vpages");

show_numa_info(m, v);


2015-11-19 00:40:44

by kernel test robot

[permalink] [raw]
Subject: Re: [patch -mm] mm, vmalloc: remove VM_VPAGES

Hi David,

[auto build test ERROR on: next-20151118]
[also build test ERROR on: v4.4-rc1]

url: https://github.com/0day-ci/linux/commits/David-Rientjes/mm-vmalloc-remove-VM_VPAGES/20151119-083326
config: i386-tinyconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

mm/vmalloc.c: In function '__vunmap':
>> mm/vmalloc.c:1484:21: error: 'VM_VPAGES' undeclared (first use in this function)
if (area->flags & VM_VPAGES)
^
mm/vmalloc.c:1484:21: note: each undeclared identifier is reported only once for each function it appears in

vim +/VM_VPAGES +1484 mm/vmalloc.c

bf53d6f8 Christoph Lameter 2008-02-04 1478 struct page *page = area->pages[i];
bf53d6f8 Christoph Lameter 2008-02-04 1479
bf53d6f8 Christoph Lameter 2008-02-04 1480 BUG_ON(!page);
bf53d6f8 Christoph Lameter 2008-02-04 1481 __free_page(page);
^1da177e Linus Torvalds 2005-04-16 1482 }
^1da177e Linus Torvalds 2005-04-16 1483
8757d5fa Jan Kiszka 2006-07-14 @1484 if (area->flags & VM_VPAGES)
^1da177e Linus Torvalds 2005-04-16 1485 vfree(area->pages);
^1da177e Linus Torvalds 2005-04-16 1486 else
^1da177e Linus Torvalds 2005-04-16 1487 kfree(area->pages);

:::::: The code at line 1484 was first introduced by commit
:::::: 8757d5fa6b75e8ea906baf0309d49b980e7f9bc9 [PATCH] mm: fix oom roll-back of __vmalloc_area_node

:::::: TO: Jan Kiszka <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.70 kB)
.config.gz (5.97 kB)
Download all attachments

2015-11-19 00:40:54

by kernel test robot

[permalink] [raw]
Subject: Re: [patch -mm] mm, vmalloc: remove VM_VPAGES

Hi David,

[auto build test WARNING on: next-20151118]
[also build test WARNING on: v4.4-rc1]

url: https://github.com/0day-ci/linux/commits/David-Rientjes/mm-vmalloc-remove-VM_VPAGES/20151119-083326
config: x86_64-randconfig-x015-11181928 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

In file included from include/linux/linkage.h:4:0,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/vmalloc.h:4,
from mm/vmalloc.c:11:
mm/vmalloc.c: In function '__vunmap':
mm/vmalloc.c:1484:21: error: 'VM_VPAGES' undeclared (first use in this function)
if (area->flags & VM_VPAGES)
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> mm/vmalloc.c:1484:3: note: in expansion of macro 'if'
if (area->flags & VM_VPAGES)
^
mm/vmalloc.c:1484:21: note: each undeclared identifier is reported only once for each function it appears in
if (area->flags & VM_VPAGES)
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> mm/vmalloc.c:1484:3: note: in expansion of macro 'if'
if (area->flags & VM_VPAGES)
^

vim +/if +1484 mm/vmalloc.c

^1da177e4 Linus Torvalds 2005-04-16 1468 return;
^1da177e4 Linus Torvalds 2005-04-16 1469 }
^1da177e4 Linus Torvalds 2005-04-16 1470
9a11b49a8 Ingo Molnar 2006-07-03 1471 debug_check_no_locks_freed(addr, area->size);
3ac7fe5a4 Thomas Gleixner 2008-04-30 1472 debug_check_no_obj_freed(addr, area->size);
9a11b49a8 Ingo Molnar 2006-07-03 1473
^1da177e4 Linus Torvalds 2005-04-16 1474 if (deallocate_pages) {
^1da177e4 Linus Torvalds 2005-04-16 1475 int i;
^1da177e4 Linus Torvalds 2005-04-16 1476
^1da177e4 Linus Torvalds 2005-04-16 1477 for (i = 0; i < area->nr_pages; i++) {
bf53d6f8f Christoph Lameter 2008-02-04 1478 struct page *page = area->pages[i];
bf53d6f8f Christoph Lameter 2008-02-04 1479
bf53d6f8f Christoph Lameter 2008-02-04 1480 BUG_ON(!page);
bf53d6f8f Christoph Lameter 2008-02-04 1481 __free_page(page);
^1da177e4 Linus Torvalds 2005-04-16 1482 }
^1da177e4 Linus Torvalds 2005-04-16 1483
8757d5fa6 Jan Kiszka 2006-07-14 @1484 if (area->flags & VM_VPAGES)
^1da177e4 Linus Torvalds 2005-04-16 1485 vfree(area->pages);
^1da177e4 Linus Torvalds 2005-04-16 1486 else
^1da177e4 Linus Torvalds 2005-04-16 1487 kfree(area->pages);
^1da177e4 Linus Torvalds 2005-04-16 1488 }
^1da177e4 Linus Torvalds 2005-04-16 1489
^1da177e4 Linus Torvalds 2005-04-16 1490 kfree(area);
^1da177e4 Linus Torvalds 2005-04-16 1491 return;
^1da177e4 Linus Torvalds 2005-04-16 1492 }

:::::: The code at line 1484 was first introduced by commit
:::::: 8757d5fa6b75e8ea906baf0309d49b980e7f9bc9 [PATCH] mm: fix oom roll-back of __vmalloc_area_node

:::::: TO: Jan Kiszka <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (3.44 kB)
.config.gz (23.31 kB)
Download all attachments

2015-11-19 01:00:11

by David Rientjes

[permalink] [raw]
Subject: Re: [patch -mm] mm, vmalloc: remove VM_VPAGES

On Thu, 19 Nov 2015, kbuild test robot wrote:

> Hi David,
>
> [auto build test ERROR on: next-20151118]
> [also build test ERROR on: v4.4-rc1]
>

You need to teach your bot what patches I'm proposing for the -mm tree
(notice the patch title) instead of your various trees.

2015-11-19 11:33:19

by kernel test robot

[permalink] [raw]
Subject: Re: [kbuild-all] [patch -mm] mm, vmalloc: remove VM_VPAGES

Hi David,

On Wed, Nov 18, 2015 at 05:00:07PM -0800, David Rientjes wrote:
> On Thu, 19 Nov 2015, kbuild test robot wrote:
>
> > Hi David,
> >
> > [auto build test ERROR on: next-20151118]
> > [also build test ERROR on: v4.4-rc1]
> >
>
> You need to teach your bot what patches I'm proposing for the -mm tree
> (notice the patch title) instead of your various trees.

Per my understanding linux-next is the -mm tree.
Or do you mean some standalone -mm git tree?

Thanks,
Fengguang

2015-11-19 12:23:54

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [kbuild-all] [patch -mm] mm, vmalloc: remove VM_VPAGES

Fengguang Wu wrote:
> Hi David,
>
> On Wed, Nov 18, 2015 at 05:00:07PM -0800, David Rientjes wrote:
> > On Thu, 19 Nov 2015, kbuild test robot wrote:
> >
> > > Hi David,
> > >
> > > [auto build test ERROR on: next-20151118]
> > > [also build test ERROR on: v4.4-rc1]
> > >
> >
> > You need to teach your bot what patches I'm proposing for the -mm tree
> > (notice the patch title) instead of your various trees.
>
> Per my understanding linux-next is the -mm tree.
> Or do you mean some standalone -mm git tree?
>
> Thanks,
> Fengguang
>

This build error will be gone when
"[PATCH] tree wide: Use kvfree() than conditional kfree()/vfree()"
(currently in -mm tree) is applied.

2015-11-19 12:35:58

by kernel test robot

[permalink] [raw]
Subject: Re: [kbuild-all] [patch -mm] mm, vmalloc: remove VM_VPAGES

On Thu, Nov 19, 2015 at 09:23:41PM +0900, Tetsuo Handa wrote:
> Fengguang Wu wrote:
> > Hi David,
> >
> > On Wed, Nov 18, 2015 at 05:00:07PM -0800, David Rientjes wrote:
> > > On Thu, 19 Nov 2015, kbuild test robot wrote:
> > >
> > > > Hi David,
> > > >
> > > > [auto build test ERROR on: next-20151118]
> > > > [also build test ERROR on: v4.4-rc1]
> > > >
> > >
> > > You need to teach your bot what patches I'm proposing for the -mm tree
> > > (notice the patch title) instead of your various trees.
> >
> > Per my understanding linux-next is the -mm tree.
> > Or do you mean some standalone -mm git tree?
> >
> > Thanks,
> > Fengguang
> >
>
> This build error will be gone when
> "[PATCH] tree wide: Use kvfree() than conditional kfree()/vfree()"
> (currently in -mm tree) is applied.

Got it. I can find that patch in the mmotm tree:

git://git.cmpxchg.org/linux-mmotm.git

I'll teach the robot to use it instead of linux-next for [-mm] patches.

Thanks,
Fengguang

2015-11-19 18:38:03

by Johannes Weiner

[permalink] [raw]
Subject: Re: [kbuild-all] [patch -mm] mm, vmalloc: remove VM_VPAGES

Hi Fengguang,

On Thu, Nov 19, 2015 at 08:35:46PM +0800, Fengguang Wu wrote:
>
> git://git.cmpxchg.org/linux-mmotm.git
>
> I'll teach the robot to use it instead of linux-next for [-mm] patches.

Yup, that seems like a more suitable base.

But you might even consider putting them on top of linux-mmots.git,
which is released more frequently than mmotm. Not sure what other MM
hackers do, but I tend to develop against mmots, and there could be
occasional breakage when dependencies haven't yet trickled into mmotm.

2015-11-20 01:49:06

by kernel test robot

[permalink] [raw]
Subject: Re: [kbuild-all] [patch -mm] mm, vmalloc: remove VM_VPAGES

On Thu, Nov 19, 2015 at 01:37:45PM -0500, Johannes Weiner wrote:
> Hi Fengguang,
>
> On Thu, Nov 19, 2015 at 08:35:46PM +0800, Fengguang Wu wrote:
> >
> > git://git.cmpxchg.org/linux-mmotm.git
> >
> > I'll teach the robot to use it instead of linux-next for [-mm] patches.
>
> Yup, that seems like a more suitable base.
>
> But you might even consider putting them on top of linux-mmots.git,

Yes, sure. I'll apply [-mm] LKML patches onto linux-mmots.git.

Thanks,
Fengguang

> which is released more frequently than mmotm. Not sure what other MM
> hackers do, but I tend to develop against mmots, and there could be
> occasional breakage when dependencies haven't yet trickled into mmotm.
> _______________________________________________
> kbuild-all mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/kbuild-all