[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47f64329-32e2-44ba-c878-ee3cccdebfea@huawei.com>
Date: Fri, 9 Feb 2018 13:34:05 +0200
From: Igor Stoppa <igor.stoppa@...wei.com>
To: Christopher Lameter <cl@...ux.com>
CC: <jglisse@...hat.com>, <keescook@...omium.org>, <mhocko@...nel.org>,
<labbott@...hat.com>, <hch@...radead.org>, <willy@...radead.org>,
<linux-security-module@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>,
<kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH 3/6] struct page: add field for vm_struct
On 05/02/18 17:33, Christopher Lameter wrote:
> On Sat, 3 Feb 2018, Igor Stoppa wrote:
>
>> - the property of the compound page will affect the property of all the
>> pages in the compound, so when one is write protected, it can generate a
>> lot of wasted memory, if there is too much slack (because of the order)
>> With vmalloc, I can allocate any number of pages, minimizing the waste.
>
> I thought the intend here is to create a pool where the whole pool becomes
> RO?
Yes, but why would I force the number of pages in the pool to be a power
of 2, when it can be any number?
If a need, say, 17 pages, I would have to allocate 32.
But it can be worse than that.
Since the size of the overall allocated memory is not known upfront, I
wold have a problem to decide how many pages to allocate, every time
there is need to grow the pool.
Or push the problem to the user of the API, who might be equally unaware.
Notice that there is already a function (prealloc) available to the user
of the API, if the size is known upfront.
So I do not really see how using compound pages would make memory
utilization better or even not worse.
--
igor
Powered by blists - more mailing lists