Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5008013imm; Tue, 16 Oct 2018 03:50:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV60o7EzPiXNmlZyHgVuvJYqIptWV3NWv4NMKqKgSkhwNEFsgOnF6B7f4yJFm67Ykv5p4BwOK X-Received: by 2002:a62:9402:: with SMTP id m2-v6mr21673407pfe.255.1539687014982; Tue, 16 Oct 2018 03:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539687014; cv=none; d=google.com; s=arc-20160816; b=dct6OTPNCxFUBO+BjeiZf1p1Laes3nbDGs42dP3tNpbjY0nAwcqZQicIuX4zxr7HKP HLLg/1fRpZgUdx0HkWYU+7J80UID7jEtc5CbsLM88SwBfA7jnkA5P7lJFGRA9kLlJc+F NVJ7tbcSQbRQpkNHv1+P4wan6ES2131iSiKOv8oQijKjIowR+aCC34v991xCewZsn8X9 9lozgkN4IrlLA2vXaGOPf5p+xrebmBj4VplJ79SExtKTPJicVSLmTmLTaWXfYIl7W6dj zfvmiN2DJRkysrdi3va344Hj0qKyTWYfEM8AKuShpYpwfQa9791E39JtGOLdheHORTP7 VG7w== 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=54dEUaVHn3mv0I12/fDO7rgtt0waxpv5IYfXzv6loKo=; b=sZagq2cdfRcrydNGMS3/4Bkj92IFOvPBa/ovkPnKanZuEtBIq62PWVDMJwBYEXr9+S BWaVYBCvhtDFYuYkvejacqTm6KqFXI5LtuVaZsh35K9IjuY6GYzsi+ZusDb0yt1xk+h4 OEvL+ouZCmgNprVquw+GFusMaJoCo3RnpwPq3H3f/sFDBOLEH5xqUjnqaTrMIuWOHSr0 Izeof0vbMR9FgQHt7mBzhGIYagTLzel269Gs34+23SGlB0s6vn/D9VFvJgg49gql5DuB oFZi4Qku2QffIpu6T4zTbhmKHR75bXGFsQxUvGV3tjebhFjdkn1uWO7FJ9l5o38/Ft5V 52jg== 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 d7-v6si12516727plo.418.2018.10.16.03.49.59; Tue, 16 Oct 2018 03:50:14 -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 S1727476AbeJPSis (ORCPT + 99 others); Tue, 16 Oct 2018 14:38:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:59980 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727218AbeJPSir (ORCPT ); Tue, 16 Oct 2018 14:38:47 -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 4A883AF79; Tue, 16 Oct 2018 10:48:56 +0000 (UTC) Date: Tue, 16 Oct 2018 12:48:55 +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: <20181016104855.GQ18839@dhcp22.suse.cz> References: <20181003073640.GF18290@dhcp22.suse.cz> <20181004055842.GA22173@dhcp22.suse.cz> <20181004094637.GG22173@dhcp22.suse.cz> <20181009083326.GG8528@dhcp22.suse.cz> <20181015150325.GN18839@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 Mon 15-10-18 15:25:14, David Rientjes wrote: > On Mon, 15 Oct 2018, Michal Hocko wrote: > > > > > No, because the offending commit actually changed the precedence itself: > > > > PR_SET_THP_DISABLE used to be honored for future mappings and the commit > > > > changed that for all current mappings. > > > > > > Which is the actual and the full point of the fix as described in the > > > changelog. The original implementation was poor and inconsistent. > > > > > > > So as a result of the commit > > > > itself we would have had to change the documentation and userspace can't > > > > be expected to keep up with yet a fourth variable: kernel version. It > > > > really needs to be simpler, just a per-mapping specifier. > > > > > > As I've said, if you really need a per-vma granularity then make it a > > > dedicated line in the output with a clear semantic. Do not make VMA > > > flags even more confusing. > > > > Can we settle with something please? > > I don't understand the point of extending smaps with yet another line. Because abusing a vma flag part is just wrong. What are you going to do when a next bug report states that the flag is set even though no userspace has set it and that leads to some malfunctioning? Can you rule that out? Even your abuse of the flag is surprising so why others wouldn't be? > The only way for a different process to determine if a single vma from > another process is thp disabled is by the "nh" flag, so it is reasonable > that userspace reads this. My patch fixes that. If smaps is extended > with another line per your patch, it doesn't change the fact that previous > binaries are built to check for "nh" so it does not deprecate that. > ("THP_Enabled" is also ambiguous since it only refers to prctl and not the > default thp setting or madvise.) As I've said there are two things. Exporting PR_SET_THP_DISABLE to userspace so that a 3rd party process can query it. I've already explained why that might be useful. If you really insist on having a per-vma field then let's do it properly now. Are you going to agree on that? If yes, I am willing to spend my time on that but I am not going to bother if this will lead to "I want my vma field abuse anyway". -- Michal Hocko SUSE Labs