* Re: [PATCH] mm: cma: Discard clean pages during contiguous allocation instead of migration [not found] <1347324112-14134-1-git-send-email-minchan@kernel.org> @ 2012-09-13 19:17 ` Geert Uytterhoeven 2012-09-13 22:19 ` Andrew Morton 0 siblings, 1 reply; 3+ messages in thread From: Geert Uytterhoeven @ 2012-09-13 19:17 UTC (permalink / raw) To: Minchan Kim Cc: Andrew Morton, linux-kernel, linux-mm, Kyungmin Park, Marek Szyprowski, Michal Nazarewicz, Rik van Riel, Mel Gorman, Linux-Next On Tue, Sep 11, 2012 at 2:41 AM, Minchan Kim <minchan@kernel.org> wrote: > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -674,8 +674,10 @@ static enum page_references page_check_references(struct page *page, > static unsigned long shrink_page_list(struct list_head *page_list, > struct zone *zone, > struct scan_control *sc, > + enum ttu_flags ttu_flags, "enum ttu_flags" is defined on CONFIG_MMU=y only, causing on nommu: mm/vmscan.c:677:26: error: parameter 4 ('ttu_flags') has incomplete type mm/vmscan.c:987:5: error: 'TTU_UNMAP' undeclared (first use in this function) mm/vmscan.c:987:15: error: 'TTU_IGNORE_ACCESS' undeclared (first use in this function) mm/vmscan.c:1312:56: error: 'TTU_UNMAP' undeclared (first use in this function) E.g. http://kisskb.ellerman.id.au/kisskb/buildresult/7191694/ (h8300-defconfig) http://kisskb.ellerman.id.au/kisskb/buildresult/7191858/ (sh-allnoconfig) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: cma: Discard clean pages during contiguous allocation instead of migration 2012-09-13 19:17 ` [PATCH] mm: cma: Discard clean pages during contiguous allocation instead of migration Geert Uytterhoeven @ 2012-09-13 22:19 ` Andrew Morton 2012-09-14 0:10 ` Minchan Kim 0 siblings, 1 reply; 3+ messages in thread From: Andrew Morton @ 2012-09-13 22:19 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Minchan Kim, linux-kernel, linux-mm, Kyungmin Park, Marek Szyprowski, Michal Nazarewicz, Rik van Riel, Mel Gorman, Linux-Next On Thu, 13 Sep 2012 21:17:19 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote: > On Tue, Sep 11, 2012 at 2:41 AM, Minchan Kim <minchan@kernel.org> wrote: > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -674,8 +674,10 @@ static enum page_references page_check_references(struct page *page, > > static unsigned long shrink_page_list(struct list_head *page_list, > > struct zone *zone, > > struct scan_control *sc, > > + enum ttu_flags ttu_flags, > > "enum ttu_flags" is defined on CONFIG_MMU=y only, causing on nommu: > > mm/vmscan.c:677:26: error: parameter 4 ('ttu_flags') has incomplete type > mm/vmscan.c:987:5: error: 'TTU_UNMAP' undeclared (first use in this function) > mm/vmscan.c:987:15: error: 'TTU_IGNORE_ACCESS' undeclared (first use > in this function) > mm/vmscan.c:1312:56: error: 'TTU_UNMAP' undeclared (first use in this function) > > E.g. > http://kisskb.ellerman.id.au/kisskb/buildresult/7191694/ (h8300-defconfig) > http://kisskb.ellerman.id.au/kisskb/buildresult/7191858/ (sh-allnoconfig) hm, OK, the means by which current mainline avoids build errors is either clever or lucky. switch (try_to_unmap(page, TTU_UNMAP)) { gets preprocessed into switch (2) { so the cmopiler never gets to see the TTU_ symbol at all. Because it happens to be inside the try_to_unmap() call. I guess we can just make ttu_flags visible to NOMMU: --- a/include/linux/rmap.h~mm-cma-discard-clean-pages-during-contiguous-allocation-instead-of-migration-fix-fix +++ a/include/linux/rmap.h @@ -71,6 +71,17 @@ struct anon_vma_chain { #endif }; +enum ttu_flags { + TTU_UNMAP = 0, /* unmap mode */ + TTU_MIGRATION = 1, /* migration mode */ + TTU_MUNLOCK = 2, /* munlock mode */ + TTU_ACTION_MASK = 0xff, + + TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ + TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ + TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ +}; + #ifdef CONFIG_MMU static inline void get_anon_vma(struct anon_vma *anon_vma) { @@ -164,16 +175,6 @@ int page_referenced(struct page *, int i int page_referenced_one(struct page *, struct vm_area_struct *, unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); -enum ttu_flags { - TTU_UNMAP = 0, /* unmap mode */ - TTU_MIGRATION = 1, /* migration mode */ - TTU_MUNLOCK = 2, /* munlock mode */ - TTU_ACTION_MASK = 0xff, - - TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ - TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ - TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ -}; #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) int try_to_unmap(struct page *, enum ttu_flags flags); _ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: cma: Discard clean pages during contiguous allocation instead of migration 2012-09-13 22:19 ` Andrew Morton @ 2012-09-14 0:10 ` Minchan Kim 0 siblings, 0 replies; 3+ messages in thread From: Minchan Kim @ 2012-09-14 0:10 UTC (permalink / raw) To: Andrew Morton Cc: Geert Uytterhoeven, linux-kernel, linux-mm, Kyungmin Park, Marek Szyprowski, Michal Nazarewicz, Rik van Riel, Mel Gorman, Linux-Next On Thu, Sep 13, 2012 at 03:19:22PM -0700, Andrew Morton wrote: > On Thu, 13 Sep 2012 21:17:19 +0200 > Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > On Tue, Sep 11, 2012 at 2:41 AM, Minchan Kim <minchan@kernel.org> wrote: > > > --- a/mm/vmscan.c > > > +++ b/mm/vmscan.c > > > @@ -674,8 +674,10 @@ static enum page_references page_check_references(struct page *page, > > > static unsigned long shrink_page_list(struct list_head *page_list, > > > struct zone *zone, > > > struct scan_control *sc, > > > + enum ttu_flags ttu_flags, > > > > "enum ttu_flags" is defined on CONFIG_MMU=y only, causing on nommu: > > > > mm/vmscan.c:677:26: error: parameter 4 ('ttu_flags') has incomplete type > > mm/vmscan.c:987:5: error: 'TTU_UNMAP' undeclared (first use in this function) > > mm/vmscan.c:987:15: error: 'TTU_IGNORE_ACCESS' undeclared (first use > > in this function) > > mm/vmscan.c:1312:56: error: 'TTU_UNMAP' undeclared (first use in this function) > > > > E.g. > > http://kisskb.ellerman.id.au/kisskb/buildresult/7191694/ (h8300-defconfig) > > http://kisskb.ellerman.id.au/kisskb/buildresult/7191858/ (sh-allnoconfig) > > hm, OK, the means by which current mainline avoids build errors is > either clever or lucky. > > switch (try_to_unmap(page, TTU_UNMAP)) { > > gets preprocessed into > > switch (2) { > > so the cmopiler never gets to see the TTU_ symbol at all. Because it > happens to be inside the try_to_unmap() call. > > > I guess we can just make ttu_flags visible to NOMMU: I agree. Geert, Andrew Thanks for the reporting and quick fix! -- Kind regards, Minchan Kim ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-14 0:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1347324112-14134-1-git-send-email-minchan@kernel.org>
2012-09-13 19:17 ` [PATCH] mm: cma: Discard clean pages during contiguous allocation instead of migration Geert Uytterhoeven
2012-09-13 22:19 ` Andrew Morton
2012-09-14 0:10 ` Minchan Kim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).