[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0591d6d4-5844-13ac-9e22-722e22c911f4@huawei.com>
Date: Mon, 16 Aug 2021 08:26:06 +0800
From: "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)"
<longpeng2@...wei.com>
To: David Laight <David.Laight@...LAB.COM>,
'Khalid Aziz' <khalid.aziz@...cle.com>,
Matthew Wilcox <willy@...radead.org>
CC: Steven Sistare <steven.sistare@...cle.com>,
Anthony Yznaga <anthony.yznaga@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"Gonglei (Arei)" <arei.gonglei@...wei.com>
Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC
Hi David,
在 2021/8/15 4:07, David Laight 写道:
> ...
>>>>> Let me describe my use case more clearly (just ignore if you're not
>>>>> interested in it):
>>>>>
>>>>> 1. Prog A mmap() 4GB memory (anon or file-mapping), suppose the
>>>>> allocated VA range is [0x40000000,0x140000000)
>>>>>
>>>>> 2. Prog A specifies [0x48000000,0x50000000) and
>>>>> [0x80000000,0x100000000) will be shared by its child.
>>>>>
>>>>> 3. Prog A fork() Prog B and then Prog B exec() a new ELF binary.
>>>>>
>>>>> 4. Prog B notice the shared ranges (e.g. by input parameters or
>>>>> ...)
>>>>> and remap them to a continuous VA range.
>
> Remapping to contiguous VA is going to be difficult in the
> general case for (IIRC) VIVT caches.
> The required cache coherence may only be attainable by
> using uncached mappings.
>
The Prog B uses mremap() syscall to remapping the shared ranges to other places,
this is a common case for mremap in userspace.
The cache coherence should already be processed in mremap core logic, otherwise
there's maybe something wrong in mremap().
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Powered by blists - more mailing lists