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=-5.5 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 73919C433B4 for ; Wed, 7 Apr 2021 15:36:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 073C16138B for ; Wed, 7 Apr 2021 15:36:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 073C16138B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E667C6B0072; Wed, 7 Apr 2021 11:36:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E18C66B007D; Wed, 7 Apr 2021 11:36:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDD466B007E; Wed, 7 Apr 2021 11:36:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id ADF3C6B0072 for ; Wed, 7 Apr 2021 11:36:36 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 663BE62D9 for ; Wed, 7 Apr 2021 15:36:36 +0000 (UTC) X-FDA: 78005973192.32.34AA8A4 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf21.hostedemail.com (Postfix) with ESMTP id 2A7C5E000105 for ; Wed, 7 Apr 2021 15:36:35 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id ha17so10006619pjb.2 for ; Wed, 07 Apr 2021 08:36:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=o/2zfrGIfr2WuDjiaGGlJLgOkerEw8dys41o+yaEHFo=; b=jbg73Ne1AW2qttyJEUkc3JqqvC+1Ln2b0vuVdoeuuK0JJhwvA62qsaEUgYiSLwsMc9 iKJD5cZaR+LGflbmd1S6LOgkdx3qN3k0J6+iOkULI1uBXNEY3Y16b2KzLEH7odWyMj+Q D92Q0r5Qp7KMVX80l3+1ltXFVmQq9sTgZU93WJ8CmhHwB3yr5yDngg7OQKUvwGv14RQt bhmd7whAOzxDlpQeZ9jn7iE3oTti/JLbeSnCIFEi0tmPO43O0MwB526Hc3dIdceAb8Zr D6YLU+OIkpHEKT+6wypaVN2Q66SaC8OoSJPMhHRW8QH4CSaSbLU4EflJ6nJNsmMc9JbP VLRA== X-Gm-Message-State: AOAM533mfzAjZfi+FU3XjSa/F85K4RN494OOYNJBp8ec60q98fgCXj/c Uax8ezkpie3FgVhkwjIYRoNa/A== X-Google-Smtp-Source: ABdhPJxAm5VRu1azG8bdwhzoCuoZnWgkzGuQZn+pSWa6NvsaTNY8AOkDybzpeoC5PYZ1Dyqay8mQ2Q== X-Received: by 2002:a17:90a:9b0a:: with SMTP id f10mr3868148pjp.213.1617809795022; Wed, 07 Apr 2021 08:36:35 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:3602:86ff:fef6:e86b? ([2601:646:c200:1ef2:3602:86ff:fef6:e86b]) by smtp.googlemail.com with ESMTPSA id t65sm1801935pfd.5.2021.04.07.08.36.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Apr 2021 08:36:34 -0700 (PDT) Subject: Re: [RFC PATCH 13/37] mm: implement speculative handling in __handle_mm_fault(). To: Michel Lespinasse , Linux-MM Cc: Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Rom Lemarchand , Linux-Kernel References: <20210407014502.24091-1-michel@lespinasse.org> <20210407014502.24091-14-michel@lespinasse.org> From: Andy Lutomirski Message-ID: Date: Wed, 7 Apr 2021 08:36:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210407014502.24091-14-michel@lespinasse.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: 1x75yner7d6kjemc51mx934yxwn1sor8 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2A7C5E000105 Received-SPF: none (amacapital.net>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=mail-pj1-f53.google.com; client-ip=209.85.216.53 X-HE-DKIM-Result: none/none X-HE-Tag: 1617809795-444240 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 4/6/21 6:44 PM, Michel Lespinasse wrote: > The page table tree is walked with local irqs disabled, which prevents > page table reclamation (similarly to what fast GUP does). The logic is > otherwise similar to the non-speculative path, but with additional > restrictions: in the speculative path, we do not handle huge pages or > wiring new pages tables. Not on most architectures. Quoting the actual comment in mm/gup.c: > * Before activating this code, please be aware that the following assumptions > * are currently made: > * > * *) Either MMU_GATHER_RCU_TABLE_FREE is enabled, and tlb_remove_table() is used to > * free pages containing page tables or TLB flushing requires IPI broadcast. On MMU_GATHER_RCU_TABLE_FREE architectures, you cannot make the assumption that it is safe to dereference a pointer in a page table just because irqs are off. You need RCU protection, too. You have the same error in the cover letter. --Andy