Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-19 Thread Song Liu
On Thu, May 17, 2018 at 10:31 AM, William Kucharski wrote: > > >> On May 17, 2018, at 9:23 AM, Matthew Wilcox wrote: >> >> I'm certain it is. The other thing I believe is true that we should be >> able to share page tables (my motivation is thousands of processes each >> mapping the same ridicul

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-17 Thread William Kucharski
> On May 17, 2018, at 9:23 AM, Matthew Wilcox wrote: > > I'm certain it is. The other thing I believe is true that we should be > able to share page tables (my motivation is thousands of processes each > mapping the same ridiculously-sized file). I was hoping this prototype > would have code

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-17 Thread Matthew Wilcox
On Mon, May 14, 2018 at 07:12:13AM -0600, William Kucharski wrote: > One of the downsides of THP as currently implemented is that it only supports > large page mappings for anonymous pages. It does also support shmem. > I embarked upon this prototype on the theory that it would be advantageous to

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-17 Thread Larry Bassel
On 17 May 18 08:23, Matthew Wilcox wrote: > > I can't find any information on what page sizes SPARC supports. > Maybe you could point me at a reference? All I've managed to find is > the architecture manuals for SPARC which believe it is not their purpose > to mandate an MMU. > Page sizes of 8K

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-17 Thread William Kucharski
> On May 17, 2018, at 1:57 AM, Michal Hocko wrote: > > [CCing Kirill and fs-devel] > > On Mon 14-05-18 07:12:13, William Kucharski wrote: >> One of the downsides of THP as currently implemented is that it only supports >> large page mappings for anonymous pages. > > There is a support for shm

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-17 Thread Michal Hocko
[CCing Kirill and fs-devel] On Mon 14-05-18 07:12:13, William Kucharski wrote: > One of the downsides of THP as currently implemented is that it only supports > large page mappings for anonymous pages. There is a support for shmem merged already. ext4 was next on the plan AFAIR but I haven't seen

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-14 Thread William Kucharski
> On May 14, 2018, at 9:19 AM, Christopher Lameter wrote: > > Cool. This could be controlled by the faultaround logic right? If we get > fault_around_bytes up to huge page size then it is reasonable to use a > huge page directly. It isn't presently but certainly could be; for the prototype it

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-14 Thread Christopher Lameter
On Mon, 14 May 2018, William Kucharski wrote: > The idea is that the kernel will attempt to allocate and map the range using a > PMD sized THP page upon first fault; if the allocation is successful the page > will be populated (at present using a call to kernel_read()) and the page will > be mappe

[RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-14 Thread William Kucharski
One of the downsides of THP as currently implemented is that it only supports large page mappings for anonymous pages. I embarked upon this prototype on the theory that it would be advantageous to be able to map large ranges of read-only text pages using THP as well. The idea is that the kernel