Received: by 10.223.176.5 with SMTP id f5csp182679wra; Tue, 30 Jan 2018 09:51:52 -0800 (PST) X-Google-Smtp-Source: AH8x2267n97HIq8hW5emWkUVts7OTWw4zgg9/n1pjpYyzOX+ZuFPmkxelfK7gBlH0ktGIi7+AKAT X-Received: by 2002:a17:902:76ca:: with SMTP id j10-v6mr16370950plt.204.1517334712872; Tue, 30 Jan 2018 09:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517334712; cv=none; d=google.com; s=arc-20160816; b=iav637/zXRVVHgSoWk9DYUMiLAaVAHHUHa0IsBXBrGAY38h5v5g8p5AaY5NrIJkElL Tt4XxWDX4INCwMqsS5gPpOAlt/J+qzj//6mFkUkSilMcaHDlO++oZ6FvUC5S4F1yV4Kd IjbjYuHvSgjs8aiWATbA8e75uDxV+Aof42xzj0S3T8A64M1PxXDlKwMqxKSVxzhWLOFj yJkC8tygvhJXgNuMuBgAyhLKE64hvKnvS98+vs4SHjjWEQM9mXZ7sFRs6FM9xXLkJ4av P+BeloyIDJvG3vyXcETZ31AMINI6WAuETtQzCNEYt/jEr64IYUXVqjwYZob0FSrFkoOS gMRQ== 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:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=EH4H3PAvcyYInkKhVAxloI5zIf/qnOqEHlUAGtNU9ko=; b=UN17FySumJEK2gNn2e1MnhFQ8QX8DEsJo3JKa3Ecpahyksu8kURwVAPhlYZNN0Eu/4 iUAdfOJbW9/TP6SXIgaIrI7yHua+ZK9k8mLfgIY7U/KGy3LtQC4j2FPQ0nFLnRcB5QRg 8oQQ7qAN7nEwgxWa7PDvOD5/zFkdBsd3O8fn5y+IONW97NKqxVsRJlfZgEHrs8NPJZK+ a8kNr5fsuQ6T9Qh0wpudRUVGxd5P/kLKV0RaRw6L1La1IMo2hgTQjGwOi8IZAvUpL6V6 +VAtwMYdc62lgkJEsxJYYKIB3RO6+udx2+vpOQOZp+X9pA0TCqA45K9Skw+psLh34UJy tz7w== 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 p8si3173202pgf.480.2018.01.30.09.51.38; Tue, 30 Jan 2018 09:51:52 -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 S1752866AbeA3Q2x (ORCPT + 99 others); Tue, 30 Jan 2018 11:28:53 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49702 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752791AbeA3Q2v (ORCPT ); Tue, 30 Jan 2018 11:28:51 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0UGQlMu117035 for ; Tue, 30 Jan 2018 11:28:50 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ftuftjjp5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jan 2018 11:28:50 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Jan 2018 16:28:48 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Jan 2018 16:28:42 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0UGSgOe36372570; Tue, 30 Jan 2018 16:28:42 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8EAC65204F; Tue, 30 Jan 2018 15:20:58 +0000 (GMT) Received: from ram.oc3035372033.ibm.com (unknown [9.80.199.167]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 21ACC52047; Tue, 30 Jan 2018 15:20:53 +0000 (GMT) Date: Tue, 30 Jan 2018 08:28:34 -0800 From: Ram Pai To: Michal Hocko Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com Subject: Re: [PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true Reply-To: Ram Pai References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-28-git-send-email-linuxram@us.ibm.com> <20180130121611.GC26445@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180130121611.GC26445@dhcp22.suse.cz> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 18013016-0016-0000-0000-0000051D8336 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013016-0017-0000-0000-0000285A2041 Message-Id: <20180130162834.GB5411@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-30_07:,, 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801300205 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 30, 2018 at 01:16:11PM +0100, Michal Hocko wrote: > On Thu 18-01-18 17:50:48, Ram Pai wrote: > [...] > > @@ -851,9 +848,13 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) > > (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); > > > > if (!rollup_mode) { > > - arch_show_smap(m, vma); > > +#ifdef CONFIG_ARCH_HAS_PKEYS > > + if (arch_pkeys_enabled()) > > + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); > > +#endif > > show_smap_vma_flags(m, vma); > > } > > + > > Why do you need to add ifdef here? The previous patch should make > arch_pkeys_enabled == F when CONFIG_ARCH_HAS_PKEYS=n. You are right. it need not be wrapped in CONFIG_ARCH_HAS_PKEYS. I had to do it because vma_pkey(vma) is not defined in some architectures. I will provide a generic vma_pkey() definition for architectures that do not support PKEYS. > Btw. could you > merge those two patches into one. It is usually much easier to review a > new helper function if it is added along with a user. ok. Thanks, RP