Received: by 10.213.65.68 with SMTP id h4csp40237imn; Thu, 15 Mar 2018 08:57:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELvfDMfA5Oh20f1pIP+Sn1iuIbom2Xhe2LxeTdsxYZ3vCWEVVIIrS+60eAy5xHzlx1W2HxOj X-Received: by 2002:a17:902:f44:: with SMTP id 62-v6mr8570345ply.27.1521129451083; Thu, 15 Mar 2018 08:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521129451; cv=none; d=google.com; s=arc-20160816; b=CveGZWF+6k9sbww1oBhIrYvBQ7IpChiaVBQJ8YYe50epDb2beLG5aaRoMkCqlhhm72 b3KZ9Z7i+Gz5jKf0zu7CTOrdtyeYfkX3JL3eYsuxm8FHCgQbdyphAvnWOycHo6WrXeN/ nGx81viuMVswpWAbgbCks84iSlOTD4vIvmDiDy8oPC++qmxp4rbqHcQB6fMsa0gWmgM+ f5wubFxiNzeRra/pfVOB9tB1Y2Z+9xcjivhMiOqHQlHzLWVwWfw/9aA91GrzgX70TISU zgQnDod48X5U5Qw+D+xeBIBYLpU8rTiPD5VWkcBA3+U+U9guMJfKU+xWYdH520KmqZUT Gocg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=vAl6d6PJLSvr3MR+5EDbFb2Ip7wOU0BN2dU8uHxpry8=; b=mc8b+h7OapCyIOhj0TI8XN0M60dxWRcGv2og5PPx8+x4zec/xwPZ/+8eAk/DaB6rF/ q+/ff8BZClwwbDj1ko/ckNHJEyddbX1WSCH5/xWtW9+Jx3E4+k2MmYPdMppTRJbDuIe3 6tQJUhE8LA1VeGF7fmutGuQ+So/dn+8CitgCcDQjw7KDF5VKC717P6i0fwJsHgrz/wf5 nOfJsmlQtF6mTKLTaH46gaOk2aK9ivZw3zTk8kIcq0p+0n3jC1MYqKUJJW8JIAjU12GF 6+DEHK0dGItKXU1OUYaxFtJtSwa3grK8nMcUvNDmxKKXKWAl/c26s8gCAZ9wanaQea86 5aSw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si4026839pfk.328.2018.03.15.08.57.15; Thu, 15 Mar 2018 08:57:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932815AbeCOPzi (ORCPT + 99 others); Thu, 15 Mar 2018 11:55:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:33190 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932653AbeCOPzg (ORCPT ); Thu, 15 Mar 2018 11:55:36 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 08:55:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,311,1517904000"; d="scan'208";a="183059333" Received: from ray.jf.intel.com (HELO [10.7.201.15]) ([10.7.201.15]) by orsmga004.jf.intel.com with ESMTP; 15 Mar 2018 08:55:35 -0700 Subject: Re: [PATCH v3] x86: treat pkey-0 special To: Thomas Gleixner , Ram Pai References: <1521061214-22385-1-git-send-email-linuxram@us.ibm.com> Cc: mingo@redhat.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, 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, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, corbet@lwn.net, arnd@arndb.de, fweimer@redhat.com, msuchanek@suse.com, Ulrich.Weigand@de.ibm.com From: Dave Hansen Message-ID: Date: Thu, 15 Mar 2018 08:55:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 02:46 AM, Thomas Gleixner wrote: >> + if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true > ever. If it does, then this wants to be fixed. I was thinking that we _do_ actually want it to seem allocated. It just get "allocated" implicitly when an mm is created. I think that will simplify the code if we avoid treating it specially in as many places as possible.