From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEB62C48BCF for ; Thu, 10 Jun 2021 00:58:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4749613F9 for ; Thu, 10 Jun 2021 00:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbhFJBAt (ORCPT ); Wed, 9 Jun 2021 21:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFJBAs (ORCPT ); Wed, 9 Jun 2021 21:00:48 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5660C061574 for ; Wed, 9 Jun 2021 17:58:53 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id g142so18837026ybf.9 for ; Wed, 09 Jun 2021 17:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M3mjj4EoLZYxsLHjSbLAkAp/jjfexiG2VptOQzcXqoU=; b=SgDiv4QhKqgy5WXYeAH/beq4Vk5LNuXSW5kb7KV4j8p6ta5EM1fr/hDEKMzI760+X6 DqTL57iqBxW2zab46r84n7ctXYoH0oefWWhYqjZbzK/pYsejzSBOEcmRUmCMktc/gaDI lhzrCbS+H7X+ciJWWl40yiLI4R9OZJPNHujmPIJwjX+rtKrY0Itbf6GwOGJOJ43YZXm/ dWGOhY3w3I87Qrol4cX3/TUtRRbQE0uIkeAOsiv9p+xijbq7TwhFjzDIKUCcGH4ix8I7 u4pR6eTwbH67UpP0d9woOWYUIV1LxRL+ALaU65ULyaFKKyMEEGG+o8PHOOua8IShAO8b xTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M3mjj4EoLZYxsLHjSbLAkAp/jjfexiG2VptOQzcXqoU=; b=bAK9MZHkJ2MOZvRzfslwjfAYdp82c58gGoG/h1l8su5RUeilefDsGQNW4lfiSwhuZQ 2IS9psuv//30CDaHtRGOYq8AS13Xzf+Rp/TV/K5Lu+1QHfAEx+VxWSO5EXtdftcpxCrY fbAjEBjBiYiLBaP5Mnyk8iEaKjk02QDLC4M9L0VsYavxms863bNmNZEtg4WsP0x6Xf8K v1gYGGRoRjSlnp1noSKLkDBeD4a+rXoqm7yUyx3L8FtQVVfQiT7P4uMs/K+TCJkCcFTO 0C4LMU1yhJB1c3XtoQ815elybdqRTF+qjIXO3mArlqtb01Kz8XHwwnm6D+eDeOlsogmc 9ucg== X-Gm-Message-State: AOAM530qe+876vhqSFbvncsGczTW/V1MLKSd3dPXq5Pr6SjKNntlbiY4 Hrb1y2R72XJcFGQ+1U2y5KBCH/IMogb6NYCqs3kv6g== X-Google-Smtp-Source: ABdhPJygNH2KQD2QLuU+00UUWls3cXcHGHurfCUsUtT3Gxw2KRHz90Md89HnQ0zHjebLcMxtFCDhKfq2OcJkWCmk0LU= X-Received: by 2002:a25:1ec2:: with SMTP id e185mr3796066ybe.23.1623286732601; Wed, 09 Jun 2021 17:58:52 -0700 (PDT) MIME-Version: 1.0 References: <20210430195232.30491-1-michel@lespinasse.org> <20210430195232.30491-9-michel@lespinasse.org> In-Reply-To: <20210430195232.30491-9-michel@lespinasse.org> From: Suren Baghdasaryan Date: Wed, 9 Jun 2021 17:58:41 -0700 Message-ID: Subject: Re: [PATCH 08/29] mm: add FAULT_FLAG_SPECULATIVE flag To: Michel Lespinasse Cc: Linux-MM , Linux-Kernel , Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Joel Fernandes , Andy Lutomirski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 30, 2021 at 12:52 PM Michel Lespinasse wrote: > > Define the new FAULT_FLAG_SPECULATIVE flag, which indicates when we are > attempting speculative fault handling (without holding the mmap lock). > > Signed-off-by: Michel Lespinasse > --- > include/linux/mm.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 8ba434287387..021fdab5b721 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -434,6 +434,7 @@ extern pgprot_t protection_map[16]; > * @FAULT_FLAG_REMOTE: The fault is not for current task/mm. > * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch. > * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals. > + * @FAULT_FLAG_SPECULATIVE: The fault is handled without holding the mmap_sem. nit: s/mmap_sem/mmap_lock > * > * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify > * whether we would allow page faults to retry by specifying these two > @@ -464,6 +465,7 @@ extern pgprot_t protection_map[16]; > #define FAULT_FLAG_REMOTE 0x80 > #define FAULT_FLAG_INSTRUCTION 0x100 > #define FAULT_FLAG_INTERRUPTIBLE 0x200 > +#define FAULT_FLAG_SPECULATIVE 0x400 > > /* > * The default fault flags that should be used by most of the > @@ -501,7 +503,8 @@ static inline bool fault_flag_allow_retry_first(unsigned int flags) > { FAULT_FLAG_USER, "USER" }, \ > { FAULT_FLAG_REMOTE, "REMOTE" }, \ > { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ > - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } > + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ > + { FAULT_FLAG_SPECULATIVE, "SPECULATIVE" } > > /* > * vm_fault is filled by the pagefault handler and passed to the vma's > -- > 2.20.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AF03C48BCD for ; Thu, 10 Jun 2021 00:58:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D678B613F9 for ; Thu, 10 Jun 2021 00:58:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D678B613F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 74C9A6B006E; Wed, 9 Jun 2021 20:58:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7243E6B0070; Wed, 9 Jun 2021 20:58:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ED266B0071; Wed, 9 Jun 2021 20:58:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 2EA5B6B006E for ; Wed, 9 Jun 2021 20:58:54 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CA9BE8249980 for ; Thu, 10 Jun 2021 00:58:53 +0000 (UTC) X-FDA: 78236004546.32.C6FFF48 Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf22.hostedemail.com (Postfix) with ESMTP id B0625C00CBDC for ; Thu, 10 Jun 2021 00:58:48 +0000 (UTC) Received: by mail-yb1-f172.google.com with SMTP id i4so38206764ybe.2 for ; Wed, 09 Jun 2021 17:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M3mjj4EoLZYxsLHjSbLAkAp/jjfexiG2VptOQzcXqoU=; b=SgDiv4QhKqgy5WXYeAH/beq4Vk5LNuXSW5kb7KV4j8p6ta5EM1fr/hDEKMzI760+X6 DqTL57iqBxW2zab46r84n7ctXYoH0oefWWhYqjZbzK/pYsejzSBOEcmRUmCMktc/gaDI lhzrCbS+H7X+ciJWWl40yiLI4R9OZJPNHujmPIJwjX+rtKrY0Itbf6GwOGJOJ43YZXm/ dWGOhY3w3I87Qrol4cX3/TUtRRbQE0uIkeAOsiv9p+xijbq7TwhFjzDIKUCcGH4ix8I7 u4pR6eTwbH67UpP0d9woOWYUIV1LxRL+ALaU65ULyaFKKyMEEGG+o8PHOOua8IShAO8b xTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M3mjj4EoLZYxsLHjSbLAkAp/jjfexiG2VptOQzcXqoU=; b=dYzQstJHQNyeWYryriphuRkrtQC0ZTfP7t/jF6PcIQSEz0ZfDD7w9opVucHI/Bb3R6 13mzuUbuWL2SKO+VboHJxE5In2aTPvpIrnZMf3IIkFO+hAnVyHDF72VNJ33nFrLM5+rN l95IO8kGgnLwwKYiINR+ge/OFQw5bTWmrjGj1w7kLpswKZznbZwvC+LY7vEvdr4rO5Dw wklLVeMEa0il+tEhR1M/GC2zmdmIn4wIsk8mVlANSRe+ydRw7Fg4i0RWiKYL8y/jGlK9 OUZzuYgHujc3GrumORh2zRMUJirLjqC9998P5i46tJ4lvkkhzJVJ9M+KJ0XzNMTMk1HR XoQw== X-Gm-Message-State: AOAM5327z1aZyemU+GJZyTmG+5of4Z38DMSPwNxG4Rt+q8eKRco9dY1K 9fmdhui8PkgzK1ZuKPr+bGm2fjIYfRakvhZ2lpFyejKWwzSmpA== X-Google-Smtp-Source: ABdhPJygNH2KQD2QLuU+00UUWls3cXcHGHurfCUsUtT3Gxw2KRHz90Md89HnQ0zHjebLcMxtFCDhKfq2OcJkWCmk0LU= X-Received: by 2002:a25:1ec2:: with SMTP id e185mr3796066ybe.23.1623286732601; Wed, 09 Jun 2021 17:58:52 -0700 (PDT) MIME-Version: 1.0 References: <20210430195232.30491-1-michel@lespinasse.org> <20210430195232.30491-9-michel@lespinasse.org> In-Reply-To: <20210430195232.30491-9-michel@lespinasse.org> From: Suren Baghdasaryan Date: Wed, 9 Jun 2021 17:58:41 -0700 Message-ID: Subject: Re: [PATCH 08/29] mm: add FAULT_FLAG_SPECULATIVE flag To: Michel Lespinasse Cc: Linux-MM , Linux-Kernel , Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Joel Fernandes , Andy Lutomirski Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: B0625C00CBDC Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=SgDiv4Qh; spf=pass (imf22.hostedemail.com: domain of surenb@google.com designates 209.85.219.172 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: zwzug5fjtix1hwcq5hs4e1y1syooprhh X-HE-Tag: 1623286728-326227 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: On Fri, Apr 30, 2021 at 12:52 PM Michel Lespinasse wrote: > > Define the new FAULT_FLAG_SPECULATIVE flag, which indicates when we are > attempting speculative fault handling (without holding the mmap lock). > > Signed-off-by: Michel Lespinasse > --- > include/linux/mm.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 8ba434287387..021fdab5b721 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -434,6 +434,7 @@ extern pgprot_t protection_map[16]; > * @FAULT_FLAG_REMOTE: The fault is not for current task/mm. > * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch. > * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals. > + * @FAULT_FLAG_SPECULATIVE: The fault is handled without holding the mmap_sem. nit: s/mmap_sem/mmap_lock > * > * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify > * whether we would allow page faults to retry by specifying these two > @@ -464,6 +465,7 @@ extern pgprot_t protection_map[16]; > #define FAULT_FLAG_REMOTE 0x80 > #define FAULT_FLAG_INSTRUCTION 0x100 > #define FAULT_FLAG_INTERRUPTIBLE 0x200 > +#define FAULT_FLAG_SPECULATIVE 0x400 > > /* > * The default fault flags that should be used by most of the > @@ -501,7 +503,8 @@ static inline bool fault_flag_allow_retry_first(unsigned int flags) > { FAULT_FLAG_USER, "USER" }, \ > { FAULT_FLAG_REMOTE, "REMOTE" }, \ > { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ > - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } > + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ > + { FAULT_FLAG_SPECULATIVE, "SPECULATIVE" } > > /* > * vm_fault is filled by the pagefault handler and passed to the vma's > -- > 2.20.1 >