Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2257812imm; Wed, 3 Oct 2018 00:39:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV62KWIMrjBdI6eYhOZieZfQZA90tlgdgHPHgpxTuIiprQGhlv9oSpc3HUX+SAEyFF9SOhGbQ X-Received: by 2002:a63:e601:: with SMTP id g1-v6mr219481pgh.290.1538552340418; Wed, 03 Oct 2018 00:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538552340; cv=none; d=google.com; s=arc-20160816; b=TkKHtxU2r/EP057YhyDx6ihT4i9J7XTLuDYDw9UzkYJKPB4ClyEDrrd0LFKz1e+tu1 8OXRybqE4ufD+OhdPJfftMqxqe1NWC38GT8zWY8cH82B0gRsgkKRDWVuXoqPppZN5zH0 DY05lM4koA/Lt8bRn5LTFNgwZLEDSkxGKEAvlYrAWc/bj0b9+7sHCPQh5A+Tfs+ipG2a myXrXy/SMOuxaidUjvkI9yYaTWBTyGzKY+5xZ9l6klJ8z/L6UZbmfQ0rDe30M++0coqt IU/fVveogJ82sx5PEdlaSO7oHsZEBIxlC060irJzAZLR6+j5WlTQc3ZQzPs1xxAp/9Da 8NQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=u6svi7/H5eKkXCz4qq5nh5PoqIDIKC4qN+ybhTZ+w8s=; b=VbMF04SThtTGz+/LsOuU/d6XqnJTLpXnz1+LAMmIAiNdp3NfL1mNP+L+RrlAL3w1eZ q51H+7jX/teN3f5OMC6OVhnYgk1b+rIITd1sijAVObQTH8ahu+XmPc0YFQPSa9AI7ooD L7mJk6uzTzK9S7WRRxNorVat2FVpFRzqXgxpC98LOHLRClWivqDeNoC/I9gvHpwaogbN 7NYKt+Ye+1DqeE9nUFQIhTaQ4qtG+TDgVnAqKyO5M2hFdU/+gkNAWVX18JmiHyfAnta2 2FRGzsLwhZfH3eCIUP4W1t8++cjvRWD8S2/yY/VHbXg/1jZepazUgB770r6k1FZYhYdS /jDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12-v6si669534plo.269.2018.10.03.00.38.45; Wed, 03 Oct 2018 00:39:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbeJCOXz (ORCPT + 99 others); Wed, 3 Oct 2018 10:23:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:60912 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726672AbeJCOXz (ORCPT ); Wed, 3 Oct 2018 10:23:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CF780ACC2; Wed, 3 Oct 2018 07:36:41 +0000 (UTC) Date: Wed, 3 Oct 2018 09:36:40 +0200 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Vlastimil Babka , Alexey Dobriyan , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org Subject: Re: [RFC PATCH] mm, proc: report PR_SET_THP_DISABLE in proc Message-ID: <20181003073640.GF18290@dhcp22.suse.cz> References: <20180924195603.GJ18685@dhcp22.suse.cz> <20180924200258.GK18685@dhcp22.suse.cz> <0aa3eb55-82c0-eba3-b12c-2ba22e052a8e@suse.cz> <20180925202959.GY18685@dhcp22.suse.cz> <20180925150406.872aab9f4f945193e5915d69@linux-foundation.org> <20180926060624.GA18685@dhcp22.suse.cz> <20181002112851.GP18290@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 02-10-18 13:29:42, David Rientjes wrote: > On Tue, 2 Oct 2018, Michal Hocko wrote: > > > On Wed 26-09-18 08:06:24, Michal Hocko wrote: > > > On Tue 25-09-18 15:04:06, Andrew Morton wrote: > > > > On Tue, 25 Sep 2018 14:45:19 -0700 (PDT) David Rientjes wrote: > > > > > > > > > > > It is also used in > > > > > > > automated testing to ensure that vmas get disabled for thp appropriately > > > > > > > and we used "nh" since that is how PR_SET_THP_DISABLE previously enforced > > > > > > > this, and those tests now break. > > > > > > > > > > > > This sounds like a bit of an abuse to me. It shows how an internal > > > > > > implementation detail leaks out to the userspace which is something we > > > > > > should try to avoid. > > > > > > > > > > > > > > > > Well, it's already how this has worked for years before commit > > > > > 1860033237d4 broke it. Changing the implementation in the kernel is fine > > > > > as long as you don't break userspace who relies on what is exported to it > > > > > and is the only way to determine if MADV_NOHUGEPAGE is preventing it from > > > > > being backed by hugepages. > > > > > > > > 1860033237d4 was over a year ago so perhaps we don't need to be > > > > too worried about restoring the old interface. In which case > > > > we have an opportunity to make improvements such as that suggested > > > > by Michal? > > > > > > Yeah, can we add a way to export PR_SET_THP_DISABLE to userspace > > > somehow? E.g. /proc//status. It is a process wide thing so > > > reporting it per VMA sounds strange at best. > > > > So how about this? (not tested yet but it should be pretty > > straightforward) > > Umm, prctl(PR_GET_THP_DISABLE)? /me confused. I thought you want to query for the flag on a _different_ process. -- Michal Hocko SUSE Labs