Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2480668imu; Wed, 21 Nov 2018 12:19:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UGCZU+baVHIckskg4kAcuEXDL2cVbX7DU0Fq5Y4dKOSro+3kdLYxUm5IXokRkN5K0E8cEj X-Received: by 2002:a63:8043:: with SMTP id j64mr7418883pgd.405.1542831558374; Wed, 21 Nov 2018 12:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542831558; cv=none; d=google.com; s=arc-20160816; b=jbRW3VoDcU33CPEEN64XiaxBZMmnIgkUsV6bf3BQQe1BUsu7xbYBLM2R6KlI+LBbW1 ulQuU0b9AEbUIPzXECfxlj2ztwtcVksb+NL0XRRiqb8n/O4nw2FgP+d2agPFqOVMUO/u 7UkS07clrohe0L8LynTl+vS+DRwVD6Yp0slCBjYoy21usLg4PiWLZquDgjFhrmuewPEW AG8KD+5rjY9DIVoLW2Ef0XMbHXBuTSgnpe5xyxYJlfcwItUvElNlR8SEtR68wZ+DoMSe M9rciHxCQCHD3JfnMSjqAWr93Mo6ebYCqTJypvwBnHx4zJqOCjDhAwR+CMwCykfCh4yy 4+dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=D/OAeifbgYb1OLLW4538SGPm9atNSaoQC44CwWxzv8k=; b=cfDpT3ZOoIGYs2VptyrouNSl9b5POobDoCQ0J4QLTM/r8OtdeP4uUvj7aN3rCbBrNw bZQmm8+FEIg5nsqrPoBrWZgUKq2BGiSVqfQ9ClF9bQrifHxrbqUqh5GmddnqNv7v6+Bx kwjOjvmUogd27sdYFaCrezK1OKkwFrtmnP/Ko/l6Ewx/nNlZmOpZotpB2pFlIEpGFdjE 9e3F9r6gAqTTFOYt6PIGuTVTvYLqm7Ajc35R9xlnFz+71embuxDpDv4Zjlm/dDCOvUCV zcH98cDMre6lRMu3yv/qLvrYAvF4RKdMPHXEQ7evAAMhBcVdQGNKc5IhbdjfEegfbCsr Vb7Q== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si13396544plr.127.2018.11.21.12.18.43; Wed, 21 Nov 2018 12:19:18 -0800 (PST) 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732738AbeKVEaB (ORCPT + 99 others); Wed, 21 Nov 2018 23:30:01 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35102 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732724AbeKVEaB (ORCPT ); Wed, 21 Nov 2018 23:30:01 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wALHmVRp023081 for ; Wed, 21 Nov 2018 12:54:38 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nwbxerkgf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 21 Nov 2018 12:54:38 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Nov 2018 17:54:36 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 21 Nov 2018 17:54:32 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wALHsVER62718092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 21 Nov 2018 17:54:31 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 234D2AE051; Wed, 21 Nov 2018 17:54:31 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24BD3AE04D; Wed, 21 Nov 2018 17:54:30 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.68]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 21 Nov 2018 17:54:30 +0000 (GMT) Date: Wed, 21 Nov 2018 18:54:28 +0100 From: Mike Rapoport To: Michal Hocko Cc: linux-api@vger.kernel.org, Andrew Morton , Alexey Dobriyan , linux-mm@kvack.org, LKML , Michal Hocko , Jan Kara , Dan Williams , David Rientjes Subject: Re: [RFC PATCH 1/3] mm, proc: be more verbose about unstable VMA flags in /proc//smaps References: <20181120103515.25280-1-mhocko@kernel.org> <20181120103515.25280-2-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181120103515.25280-2-mhocko@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18112117-0020-0000-0000-000002EBA99C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112117-0021-0000-0000-0000213AE2FF Message-Id: <20181121175427.GB5704@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-21_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811210155 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 11:35:13AM +0100, Michal Hocko wrote: > From: Michal Hocko > > Even though vma flags exported via /proc//smaps are explicitly > documented to be not guaranteed for future compatibility the warning > doesn't go far enough because it doesn't mention semantic changes to > those flags. And they are important as well because these flags are > a deep implementation internal to the MM code and the semantic might > change at any time. > > Let's consider two recent examples: > http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz > : commit e1fb4a086495 "dax: remove VM_MIXEDMAP for fsdax and device dax" has > : removed VM_MIXEDMAP flag from DAX VMAs. Now our testing shows that in the > : mean time certain customer of ours started poking into /proc//smaps > : and looks at VMA flags there and if VM_MIXEDMAP is missing among the VMA > : flags, the application just fails to start complaining that DAX support is > : missing in the kernel. > > http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com > : Commit 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active") > : introduced a regression in that userspace cannot always determine the set > : of vmas where thp is ineligible. > : Userspace relies on the "nh" flag being emitted as part of /proc/pid/smaps > : to determine if a vma is eligible to be backed by hugepages. > : Previous to this commit, prctl(PR_SET_THP_DISABLE, 1) would cause thp to > : be disabled and emit "nh" as a flag for the corresponding vmas as part of > : /proc/pid/smaps. After the commit, thp is disabled by means of an mm > : flag and "nh" is not emitted. > : This causes smaps parsing libraries to assume a vma is eligible for thp > : and ends up puzzling the user on why its memory is not backed by thp. > > In both cases userspace was relying on a semantic of a specific VMA > flag. The primary reason why that happened is a lack of a proper > internface. While this has been worked on and it will be fixed properly, > it seems that our wording could see some refinement and be more vocal > about semantic aspect of these flags as well. > > Cc: Jan Kara > Cc: Dan Williams > Cc: David Rientjes > Signed-off-by: Michal Hocko > --- > Documentation/filesystems/proc.txt | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt > index 12a5e6e693b6..b1fda309f067 100644 > --- a/Documentation/filesystems/proc.txt > +++ b/Documentation/filesystems/proc.txt > @@ -496,7 +496,9 @@ flags associated with the particular virtual memory area in two letter encoded > > Note that there is no guarantee that every flag and associated mnemonic will > be present in all further kernel releases. Things get changed, the flags may > -be vanished or the reverse -- new added. > +be vanished or the reverse -- new added. Interpretatation of their meaning > +might change in future as well. So each consumnent of these flags have to consumer? has > +follow each specific kernel version for the exact semantic. > > This file is only present if the CONFIG_MMU kernel configuration option is > enabled. > -- > 2.19.1 > -- Sincerely yours, Mike.