lkml.org 
[lkml]   [2017]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] Tagging of vmalloc pages for supporting the pmalloc allocator
From
Date
On 03/08/17 14:48, Michal Hocko wrote:
> On Thu 03-08-17 13:11:45, Igor Stoppa wrote:
>> On 02/08/17 20:08, Jerome Glisse wrote:
>>> On Wed, Aug 02, 2017 at 06:14:28PM +0300, Igor Stoppa wrote:

[...]

>>>> from include/linux/mm_types.h:
>>>>
>>>> struct page {
>>>> ...
>>>> union {
>>>> unsigned long private; /* Mapping-private opaque data:
>>>> * usually used for buffer_heads
>>>> * if PagePrivate set; used for
>>>> * swp_entry_t if PageSwapCache;
>>>> * indicates order in the buddy
>>>> * system if PG_buddy is set.
>>>> */

[...]

>> If the "Mapping-private" was dropped or somehow connected exclusively to
>> the cases listed in the comment, then I think it would be more clear
>> that the comment needs to be intended as related to mapping in certain
>> cases only.
>> But it is otherwise ok to use the "private" field for whatever purpose
>> it might be suitable, as long as it is not already in use.
>
> I would recommend adding a new field into the enum...

s/enum/union/ ?

If not, I am not sure what is the enum that you are talking about.

[...]

>> But, to reply more specifically to your advice, yes, I think I could add
>> a flag to vm_struct and then retrieve its value, for the address being
>> processed, by passing through find_vm_area().
>
> ... and you can store vm_struct pointer to the struct page there

"there" as in the new field of the union?
btw, what would be a meaningful name, since "private" is already taken?

For simplicity, I'll use, for now, "private2"

> and you> won't need to do the slow find_vm_area. I haven't checked
very closely
> but this should be possible in principle. I guess other callers might
> benefit from this as well.

I am confused about this: if "private2" is a pointer, but when I get an
address, I do not even know if the address represents a valid pmalloc
page, how can i know when it's ok to dereference "private2"?

Since it's just another field in a union, it can actually contain a
value that should be interpreted as some other field, right?

--
thanks, igor

\
 
 \ /
  Last update: 2017-08-03 14:23    [W:0.076 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site