Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp894652pxf; Wed, 7 Apr 2021 14:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyelp49GATi+m4xfB96FpRAVCTc6ogMetBR5UD3i1V2xblUA5RzRtIAAmlecw0aU0eK2PvP X-Received: by 2002:a17:906:3649:: with SMTP id r9mr6155101ejb.342.1617830606716; Wed, 07 Apr 2021 14:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617830606; cv=none; d=google.com; s=arc-20160816; b=VSyDElc5fzhl4uHMbcadyyJF0QIlK6vyuo74b4SPeJDHy2S3Dn9ZaSmfZQ7S2Xr66X CfvTvRc5GpORIw4fhWRoh+Y1T6AYccDBLyFDklisBXxS8i5TnY0pMax49W06CP/VTwIf NvhhxZ8lHHhjFjiVT9Hak0yw0/dmVA2HsUqmnnTAGK6Y67VvxOkKw+oJraLUVLBnoFDq nNwbzHJs5Wr3iPo4xuDKlYhk0cODfuw2AHni2ECXpCTY90wr6UDzJ0txSCk4r6W/LQ7/ FSErpoJrRTw4iPR7mu4msziAgiZNXGfPBN5gK3PVp3dYkTBz2gpsdQS8lR2vf29eMe5p MJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=o/2zfrGIfr2WuDjiaGGlJLgOkerEw8dys41o+yaEHFo=; b=qdZgxeoGbzh4BqWuF3WnTIpeg8ZZOplkUkSnsF2VTuxsSw9gmmFVHufhQCDp5F+Gur Yq/o70omndBfiSND1f8tJrYUvtIulA1UZ4uqU1TEgROfqX+nZvvDHjRrt6qM4pyj/1bm KHkCet+UWcbyQqTSiySqOcXNmrcgGc3GZy8ye2l895fitNuEhPs63kYRWYSpH8pW8QyR F+hDF27c+8TQsyhtr+i3nFFAqWKzMcv2LOYgKeYmi5hHfsMgL+9yiLx01Ho7ySfRKnhE D+2zyq+kP2qHK/+HhJn3SPBxzs9DLADzDMcG+ULHLmWHk0fwrScr20IxnSDoC8f4g+an ynqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm24si12233405edb.297.2021.04.07.14.23.03; Wed, 07 Apr 2021 14:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243481AbhDGPgs (ORCPT + 99 others); Wed, 7 Apr 2021 11:36:48 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:56289 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbhDGPgq (ORCPT ); Wed, 7 Apr 2021 11:36:46 -0400 Received: by mail-pj1-f48.google.com with SMTP id nh5so7781141pjb.5 for ; Wed, 07 Apr 2021 08:36:36 -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=XNRoNd5ffnUbqc6wSS2Ck9wUD2LKqvBHTMy0jy+pGyxa0yFWxsKPV9NvjW5olY6WyP gz4ZYmkmVDIpxvEr11ST2iYj65OqY0eUKloAOFUiPVA2Qccr0Z4yMAkMKrS/1OinjcQ1 u9zf18qJsD+tWwlCJa+kVgmVxx6EX0ZVWuT3vjafK7dlRqDdnLx8MLPmk4jrbDKeJxKj N1waPzweIKp5DvwE2xhHKMQIPlWFhqd0v76SQ0FZVHy8+HdjxfX3mQ9JSobsUyCOBxMO omqIgx2pvgcmkCLr7lQejOCA3jMSYirci97qt+jZlsfgsMGJzXRl/CY5P3p63vJbvdTK V1vA== X-Gm-Message-State: AOAM533/wWZY4uP5iGvrmYZ3bBFx5epF6W6Ah8Fz1JMOhlC2zEZeFWVk oVlBCFrPJ1wc93Oo56PjECayNA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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