Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp347385imm; Tue, 25 Sep 2018 23:08:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV63vfX46gzFJYJdYFYdYlzu/U/uCBZ/uUhdAlG3WO3WbWlFS6WzkWIA0rUmriua1Ncz76L7P X-Received: by 2002:a63:5445:: with SMTP id e5-v6mr4158050pgm.316.1537942118220; Tue, 25 Sep 2018 23:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537942118; cv=none; d=google.com; s=arc-20160816; b=OboeFGmlb0l9RHCY1GZGwnDx2iUMm3Zv6cGa3GFr4ZPP6VcgDrzl4Uzd2coj79Syy+ RmsBlflndYkAJcwsqS2ho1FOQwgmQeQupGGbNitx6UR7QhzSoIeP47sKV1ZyRSkfLK1l dJQyM4zKdlQ4BZhqA1/5ZR6uPuTSWVMdsDVdiFKm7rfqF80+/rlcwItvslZ3tqn719QY ya4CzWfTR2zhr5zXLYBl8efWoBPC5IQ2yl9OHB8aNy/ELXGlH95wyvu1mmpP7ZlTmAAB xDVNjwgePRi8Fpc06br0SI+4RfqN1paJRbKRbQnjIOOAv0mCoHAB6QR/rIRmx3Ph3krd jS3w== 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=f1Fe7olzQGR54XwCqauFZRj8sx/2IfKy4uJAepImLFU=; b=SKs1UhHExcfpt+O0JtS3Pkf5R8kkzPvRQbJttFbUoESH1XzETZjfCBgpPbergbfDG6 5nR2BoExu/POWffTeq9mOkpo1qxk/RQODi3m6CkPfGKjuZiYjm0I0OpyqBXCJwIhuBDj LzTszDXrJG3o14p0beiQbsEO3KdFd52XUzFzT8qnb5tWe717P2bhTbOF+ENqf2jR1bjd x/MqIRm2664tFaTw7N/A7xaa70TwAmV4AFJoFLcJwGahdyGJj0eRZcHQxIugInLspT+h Pe5gp7vpRzr56EHS9zV+iVUTvDf2dJOIoJK4+0vZ+UOe9Kgw6yiHc3JzFcKu12BAYxXh 54Fw== 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 o2-v6si4417159pga.521.2018.09.25.23.08.22; Tue, 25 Sep 2018 23:08:38 -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 S1727043AbeIZMRn (ORCPT + 99 others); Wed, 26 Sep 2018 08:17:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:55284 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbeIZMRm (ORCPT ); Wed, 26 Sep 2018 08:17:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DEF98AD05; Wed, 26 Sep 2018 06:06:25 +0000 (UTC) Date: Wed, 26 Sep 2018 08:06:24 +0200 From: Michal Hocko To: Andrew Morton Cc: David Rientjes , Vlastimil Babka , Alexey Dobriyan , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org Subject: Re: [patch v2] mm, thp: always specify ineligible vmas as nh in smaps Message-ID: <20180926060624.GA18685@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180925150406.872aab9f4f945193e5915d69@linux-foundation.org> 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 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. This would also keep a sane (and currently documented) semantic for the smaps flag to be really hg - huge page advise flag nh - no-huge page advise flag -- Michal Hocko SUSE Labs