From patchwork Mon Jan 9 20:53:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13094296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 876D6C5479D for ; Mon, 9 Jan 2023 20:54:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2934B8E0009; Mon, 9 Jan 2023 15:54:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2445C8E0001; Mon, 9 Jan 2023 15:54:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E39C8E0009; Mon, 9 Jan 2023 15:54:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 017648E0001 for ; Mon, 9 Jan 2023 15:54:58 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CF9491C65BD for ; Mon, 9 Jan 2023 20:54:58 +0000 (UTC) X-FDA: 80336465076.14.D2C9A52 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf05.hostedemail.com (Postfix) with ESMTP id 352CF100002 for ; Mon, 9 Jan 2023 20:54:56 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=RmMHlCmm; spf=pass (imf05.hostedemail.com: domain of 3IH-8YwYKCDUjliVeSXffXcV.TfdcZelo-ddbmRTb.fiX@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3IH-8YwYKCDUjliVeSXffXcV.TfdcZelo-ddbmRTb.fiX@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673297697; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=B6J4oGWYAsMb5e7sz4HwYEXURXCKE081WlUNIaNvLis=; b=XnWLAvUZMfRO+tcBYMoUYvyrUU4zYbISk8HJypL1gBoaYKHmQHodZ49nrsebqnq20RU9v7 Gz4uBlYTBE+8HdaKY2nSh84RUdUGSZNq149MpSMzDT3iyP4M+3CHQtxsXs5m9JtdVob0Ew eIJ7sEddtQrx5PGIf7zDNa34zf7hFDA= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=RmMHlCmm; spf=pass (imf05.hostedemail.com: domain of 3IH-8YwYKCDUjliVeSXffXcV.TfdcZelo-ddbmRTb.fiX@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3IH-8YwYKCDUjliVeSXffXcV.TfdcZelo-ddbmRTb.fiX@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673297697; a=rsa-sha256; cv=none; b=Re+ctcaVwUTqB2lEH6DkcxLLuPLdvhgHYV3uDR9JeVq6bOf1uQMgvCSVw7kATRelyBCLIB VM/snaL4rSvXE6z7UYARLMhcNYoxjypkGEV9nILLdnLPM7VyfJQPAT6pEIDyV/U65PRAHX 64rZ7ACH4Bg+7fnDFx3/stQL1VBImEY= Received: by mail-yb1-f201.google.com with SMTP id i10-20020a25f20a000000b006ea4f43c0ddso10382392ybe.21 for ; Mon, 09 Jan 2023 12:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=B6J4oGWYAsMb5e7sz4HwYEXURXCKE081WlUNIaNvLis=; b=RmMHlCmm38xVKeEsK8n8bfn/aY3rbZqU5QjWJwlg7PYpTvR8g1QwX79gxnClyI+zIW JCQh5e4SjFQ2Q8nxF5bjIKp19Ks1VtVZP+kR4i8xND+6Fj+6CTJ8vlU6n1mfUhVhmmz7 +sE7byDQX+/dNdDepWb8tj8CSiQt6RCyFFAm480IRiAV2JLM0c7a5e0c36lCq09bYHwP wg+XvRL1iHdJUlNZBka6/ieT4oXpnPfG2/UuJktrbb0wvhMWj6jl5RcTqQ78qy0Rsk8c 4BQSRlXhCecUdC5ZETwJhxsGpmEcobjcEL9EE3pAQY+ImA2TDfMr31CaGMQDdx5w7rZe dkaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B6J4oGWYAsMb5e7sz4HwYEXURXCKE081WlUNIaNvLis=; b=3eUY457JqJqoCTI2OTel+oiMCbcLDzSC1WiHarWKU5Q/gvKxguhsgQGoJVYH9Iy9x8 K6iWXxTnhS+R7unEXkIl1rAYuOOhYQoSDF5lB7SZprzV7DiaNKEGH/mWV+a0HlRmzpDe wbQUZPdrMmaDCPpXFAROE7Ke5FWCwPx+jTY+YUWMiZRmlIxqXMEFkKhkH9gFXk1tEXSx gExuZwmMZnbd+drsLBPQSs41myHKSeGO++8P21sRr0XYIEgt4b3CdNmP1L+ILgTqG0OC ChLRn4YmowlR54r2iNoi48l/p926GbY3QXs2WT9ZE1yni8s50T6zu+ixKfVU1OSo8TGi nQ5g== X-Gm-Message-State: AFqh2krTSYYgdc63atLKdgEOb1vftYWfdRTkE26JSqRQYhnV00ulEwe+ Kw2aOoc7nuAnQ43hkhOdbgyLMpvqZvM= X-Google-Smtp-Source: AMrXdXvwV2DJ0LbEXE5ZgdwVnwlID+Hh7Y6icoi6WDsC3E+JAvvNZYvjiQv0jw9VN21R/xnRr9wwO4IvIuA= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:9393:6f7a:d410:55ca]) (user=surenb job=sendgmr) by 2002:a25:e7c7:0:b0:7bf:cf52:ede5 with SMTP id e190-20020a25e7c7000000b007bfcf52ede5mr196156ybh.626.1673297696306; Mon, 09 Jan 2023 12:54:56 -0800 (PST) Date: Mon, 9 Jan 2023 12:53:25 -0800 In-Reply-To: <20230109205336.3665937-1-surenb@google.com> Mime-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230109205336.3665937-31-surenb@google.com> Subject: [PATCH 30/41] mm: add FAULT_FLAG_VMA_LOCK flag From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, paulmck@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 352CF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REo8sPx2Ok+svorkop3BG99qunkTP5RLJ1XvHgwXq7pbHCpJfu7OAwO7FdbBAQO9gf7nenkty86QaRFGsLk5Omgd4f44GvgkD1QbzXXaXwjoPW371VitAKv0do/ShnNgvQYy9sz3BhMxZbf0rGEGood66nhjsT2R4MiENm+hTpdHnROWJ6ZLfchIFX/758UyViOLIvVBnfHfNTijwH9UQV+z0TJcM7HzqWfNgYMoGu0s71k5iSF20L1K0Y5D9vOwcNWNFVU69C0AxKwsQykBoosdmZp6AUxpFeflyo5ec+b1SnUbYv3KOlodX2/lTvYeVC8rWQkU6C4UkVF4c+ZGMVOqJFDuOP1Tchw2DUruzgdFfWxNiX8oXns1O5zDameU6CCmOUD0Y+JV+HBYbWX8X X-Bogosity: Ham, tests=bogofilter, spamicity=0.000815, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add a new flag to distinguish page faults handled under protection of per-vma lock. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- include/linux/mm.h | 3 ++- include/linux/mm_types.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index d0fddf6a1de9..2e3be1d45371 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -467,7 +467,8 @@ static inline bool fault_flag_allow_retry_first(enum fault_flag flags) { FAULT_FLAG_USER, "USER" }, \ { FAULT_FLAG_REMOTE, "REMOTE" }, \ { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ + { FAULT_FLAG_VMA_LOCK, "VMA_LOCK" } /* * vm_fault is filled by the pagefault handler and passed to the vma's diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0d27edd3e63a..fce9113d979c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -1103,6 +1103,7 @@ enum fault_flag { FAULT_FLAG_INTERRUPTIBLE = 1 << 9, FAULT_FLAG_UNSHARE = 1 << 10, FAULT_FLAG_ORIG_PTE_VALID = 1 << 11, + FAULT_FLAG_VMA_LOCK = 1 << 12, }; typedef unsigned int __bitwise zap_flags_t;