lkml.org 
[lkml]   [2014]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: uprobes && shmem (Was: uprobes: Shift ->readpage check from __copy_insn() to uprobe_register())
On 05/16, Hugh Dickins wrote:
>
> 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.

Yes, this should work, swap_address_space() can't be seen as ->i_mapping,

> (Sorry for going on about backporting, when you may have no such intention.)

No, no, thanks for additional info. Perhaps we will actually backport
this, at least in rhel. Although in the latter case perhaps it would
be better to extract shmem_mapping() from 0cd6144aadd2, it is simple
and straightforward.

Thanks,

Oleg.



\
 
 \ /
  Last update: 2014-05-17 19:41    [W:0.066 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site