From patchwork Fri Jun 29 22:39:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10497709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F7236016C for ; Fri, 29 Jun 2018 22:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EFC729738 for ; Fri, 29 Jun 2018 22:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6321D2973E; Fri, 29 Jun 2018 22:40:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CDB29738 for ; Fri, 29 Jun 2018 22:40:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47A666B000C; Fri, 29 Jun 2018 18:40:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 400EB6B000D; Fri, 29 Jun 2018 18:40:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C9566B0010; Fri, 29 Jun 2018 18:40:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id D613C6B000C for ; Fri, 29 Jun 2018 18:40:47 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id x23-v6so5731486pln.11 for ; Fri, 29 Jun 2018 15:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=yjclfZOPZESO2Evik836GVkdoDxJFJbOxxkIUnPt4RE=; b=eWbvqlelvCXepzxt+GvYLUwB+L1uwxLcLUvhS7fDUScSh+YJ6z0ITA1nZFCsZfl3ZI VORi3hXZlPcrUiiO/UxXYq5I9HHFNkWNHA4Sg8N8FTBVAtdWYsCYe2Egv6N+ooZu9RbF njVyr8pNdV5GKCU5Li5uFrryXp3pn3hpoJ8GSFw52S/Rft4CzOZPnN5XRqqZr13QHg/J m9UZ0iCP8zR1KfTgvN0ygRjCwth93aKFHs86dCynSE+fO+qorsstsI4dsrzZWaDaqO+e VKLQK6PFxnUy9CsJzxr3rclU84HEOXTeLj7atIWRFbxb0149VNjosMMNJ1c48TUfGjME MJEw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: APt69E1kzvyJaVA4Hyg5CpmsKcpYOg+7TBYD0l64zoscLuyUAVrY0ju7 FKjYL19jhosAVHFwvD74X98xuPCRY66J5nCe06AoxhjDjy+Zagw2iX6DKRRP3m8lcXDugL13sIY Khtdx+I1YT2SXhpcQuKPES31REnnWBVLY08cQ3BM/hi9KFS49KYbcXs1nGwMjdsq7Ww== X-Received: by 2002:a62:403:: with SMTP id 3-v6mr16117754pfe.28.1530312047552; Fri, 29 Jun 2018 15:40:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeo72aEWPQvmO63QJse6T3mIIcTNK5LO/8P6hRTSBExX1OttyHdPjSwL3tJ9G0B09sW5ITm X-Received: by 2002:a62:403:: with SMTP id 3-v6mr16117713pfe.28.1530312046533; Fri, 29 Jun 2018 15:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530312046; cv=none; d=google.com; s=arc-20160816; b=Kj0Ws4SOm7u/v/wGZY0Yco4U2HEoc0gn/D5pOFxbkmAWKr4EADQyQRnhwRsDSOQxnA pDATWlq5fPOTN6S674zEvMA8jhVPY2J/3194TJjdnSUAGnEigX80n/qsvlDz5v5ZFt9k OChrUqzbMTV8e8gvVrLNz4wgv6nmrZsU7+BjBieWoBpnao7QBF8fa4ISmkjfV4dmhd/i NSJPNbpLmteDKJHMhYYEdlzzFyhZz02XRqWRtMYEtZ1nSUkW/giaZ7bs0qiRbF11kt+c YjimBomgzBlC8wKOye7lloO4YFFoUOa5eUH2KSKUhASf8fL7PRbLgHeFS2Qaguov+MRH DA9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yjclfZOPZESO2Evik836GVkdoDxJFJbOxxkIUnPt4RE=; b=DAr/MfuD5CxLiKf/sjoI7qTnM9DJcx+kQ1Uo0bqCbNlMdIyrxVj9RDGwfT5kTHGR77 1B0WJRODXsy0ZM8WWA52GsbAFPHhXSlS1fgb4VcJ2g4SDGWj2aGly4vOyrAdznR3Jtwt hohE93AASON5GDuR8wd/HWrFjtvVXd1CqZPnWEklCgND5dnWLBIo/IratbomrnJVYlwj MEJvQ84rJgS9Qh1vePdh5ZHFNTmG1/tLr/dXzZgYW5Qc3t6xM9pvt+DJr1fiwd8EdIuQ kLqy0jAlFLImK8T+HV3ZQLJrISK/71FuGVRI/4tlth7fOPuUJzm+ECpEvM7zENuuMCkV IrwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com. [47.88.44.36]) by mx.google.com with ESMTPS id a1-v6si10452516plp.247.2018.06.29.15.40.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 15:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) client-ip=47.88.44.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; CH=green; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e07402; MF=yang.shi@linux.alibaba.com; NM=1; PH=DS; RN=16; SR=0; TI=SMTPD_---0T3dXmHm_1530312021; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T3dXmHm_1530312021) by smtp.aliyun-inc.com(127.0.0.1); Sat, 30 Jun 2018 06:40:29 +0800 From: Yang Shi To: mhocko@kernel.org, willy@infradead.org, ldufour@linux.vnet.ibm.com, akpm@linux-foundation.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, tglx@linutronix.de, hpa@zytor.com Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [RFC v3 PATCH 2/5] mm: introduce VM_DEAD flag Date: Sat, 30 Jun 2018 06:39:42 +0800 Message-Id: <1530311985-31251-3-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530311985-31251-1-git-send-email-yang.shi@linux.alibaba.com> References: <1530311985-31251-1-git-send-email-yang.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP VM_DEAD flag is used to mark a vma is being unmapped, access to this area will trigger SIGSEGV. This flag will be used by the optimization for unmapping large address space (>= 1GB) in the later patch. It is 64 bit only at the moment, since: * we used up vm_flags bit for 32 bit * 32 bit machine typically will not have such large mapping All architectures, which support 64 bit, need check this flag in their page fault handler. This is implemented in later patches. Suggested-by: Michal Hocko Signed-off-by: Yang Shi --- include/linux/mm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index a0fbb9f..28a3906 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -242,6 +242,12 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, #endif #endif /* CONFIG_ARCH_HAS_PKEYS */ +#ifdef CONFIG_64BIT +#define VM_DEAD BIT(37) /* bit only usable on 64 bit kernel */ +#else +#define VM_DEAD 0 +#endif + #if defined(CONFIG_X86) # define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ #elif defined(CONFIG_PPC)