[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <361e39e9-517a-2fc2-016c-23f9359fef0a@intel.com>
Date: Thu, 4 May 2017 10:24:42 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Michal Hocko <mhocko@...nel.org>,
Igor Stoppa <igor.stoppa@...wei.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: RFC v2: post-init-read-only protection for data allocated
dynamically
On 05/04/2017 07:01 AM, Michal Hocko wrote:
> Just to make my proposal more clear. I suggest the following workflow
>
> cache = kmem_cache_create(foo, object_size, ..., SLAB_SEAL);
>
> obj = kmem_cache_alloc(cache, gfp_mask);
> init_obj(obj)
> [more allocations]
> kmem_cache_seal(cache);
>
> All slab pages belonging to the cache would get write protection. All
> new allocations from this cache would go to new slab pages. Later
> kmem_cache_seal will write protect only those new pages.
Igor, what sizes of objects are you after here, mostly?
I ask because slub, at least, doesn't work at all for objects
>PAGE_SIZE. It just punts those to the page allocator. But, you
_could_ still use vmalloc() for those.
Powered by blists - more mailing lists