From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758665AbdAJXwg (ORCPT ); Tue, 10 Jan 2017 18:52:36 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34219 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbdAJXwd (ORCPT ); Tue, 10 Jan 2017 18:52:33 -0500 Date: Tue, 10 Jan 2017 15:52:31 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Vlastimil Babka cc: Hugh Dickins , Mel Gorman , Andrew Morton , Michal Hocko , Jonathan Corbet , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, thp: add new background defrag option In-Reply-To: Message-ID: References: <20170105101330.bvhuglbbeudubgqb@techsingularity.net> <558ce85c-4cb4-8e56-6041-fc4bce2ee27f@suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Jan 2017, Vlastimil Babka wrote: > > I get very confused by the /sys/kernel/mm/transparent_hugepage/defrag > > versus enabled flags, and this may be a terrible, even more confusing, > > idea: but I've been surprised and sad to see defrag with a "defer" > > option, but poor enabled without one; and it has crossed my mind that > > perhaps the peculiar "madvise+defer" syntax in defrag might rather be > > handled by "madvise" in defrag with "defer" in enabled? Or something > > like that: 4 x 4 possibilities instead of 5 x 3. > > But would all the possibilities make sense? For example, if I saw > "defer" in enabled, my first expectation would be that it would only use > khugepaged, and no THP page faults at all - possibly including madvised > regions. > And this is why I've tried to minimize the config requirements and respect userspace decisions to do MADV_HUGEPAGE, MADV_NOHUGEPAGE, or set/clear PR_SET_THP_DISABLE because all these system-wide options combined with userspace syscalls truly seems unmaintainable and waay too confusing to correctly describe. Owell, I am fine with introducing yet-another-defrag-mode if it lets us move in a direction that supports our usecase.