[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.11.1405161847040.5810@eggly.anvils>
Date: Fri, 16 May 2014 19:07:13 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Oleg Nesterov <oleg@...hat.com>
cc: Johannes Weiner <hannes@...xchg.org>, Ingo Molnar <mingo@...e.hu>,
Denys Vlasenko <dvlasenk@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: uprobes && shmem (Was: uprobes: Shift ->readpage check from
__copy_insn() to uprobe_register())
On Fri, 16 May 2014, Hugh Dickins wrote:
> On Fri, 16 May 2014, Oleg Nesterov wrote:
> > shmem_getpage_gfp(). But, is there any way to figure out that this
> > inode/mapping/aops/whatever is actually shmem?
>
> On 3.15 and later, you're in luck: Hannes added bool shmem_mapping(mapping)
> in his 0cd6144aadd2 "mm + fs: prepare for non-page entries in page cache
> radix trees"; and I just checked, it builds for "tiny" !CONFIG_SHMEM too.
>
> If you're backporting to an earlier kernel, it would probably be best
> to add in a very small patch, extracting just shmem_mapping() and its
> linux/mm.h declarations from 0cd6144aadd2.
Looking into something else, I've just been reminded of
mapping_cap_swap_backed(mapping): mm/madvise.c has been using that test
for a year. It also returns true on swapper_space, the imaginary mapping
you get from a PageSwapCache page: so I suppose it would be wrong to make
Hannes's shmem_mapping() a wrapper to that. But for any backport of your
change, it would better than extracting part of 0cd6144aadd2.
(Sorry for going on about backporting, when you may have no such intention.)
Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists