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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BDB3ECAAD3 for ; Thu, 1 Sep 2022 22:35:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4D1880077; Thu, 1 Sep 2022 18:35:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFCEC8000D; Thu, 1 Sep 2022 18:35:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C6FB80077; Thu, 1 Sep 2022 18:35:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8E75D8000D for ; Thu, 1 Sep 2022 18:35:17 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 600EF1C6973 for ; Thu, 1 Sep 2022 22:35:17 +0000 (UTC) X-FDA: 79864973874.04.60B03F1 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id F3F4E180043 for ; Thu, 1 Sep 2022 22:35:16 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0C331B8295C; Thu, 1 Sep 2022 22:35:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C2CEC433D7; Thu, 1 Sep 2022 22:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662071713; bh=7lqxqTpaMBwlZW0DSt1oaG7L/tirGOWXezyya6SssGw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=L8P4/+OWOF8vcXLf28d5JYnqkdP+h60aSW1hWyuT35xqluQ2xyMH8/Y9XF+m1xCwP GSwZ79909apGLOvVmpwhgfWdqVgbtL7n8qFx+tRrOIN8/sLwtL9drhhbVQhGHYB7uO Yi2wmOxfbogqjMu3T723bgBw12MFT/tGrs+G6W2s= Date: Thu, 1 Sep 2022 15:35:12 -0700 From: Andrew Morton To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Jason Gunthorpe , John Hubbard , Andrea Arcangeli , Hugh Dickins , Peter Xu , Alistair Popple , Nadav Amit , Yang Shi , Vlastimil Babka , Michal Hocko , Mike Kravetz , Andrea Parri , Will Deacon , Peter Zijlstra , "Paul E. McKenney" , Christoph von Recklinghausen , Don Dutile Subject: Re: [PATCH v1] mm: fix PageAnonExclusive clearing racing with concurrent RCU GUP-fast Message-Id: <20220901153512.a59e9e584fb00a350788f56e@linux-foundation.org> In-Reply-To: <20220901083559.67446-1-david@redhat.com> References: <20220901083559.67446-1-david@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662071717; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3QpBNOL76/Na9N+W9UPDTiPYBl8ube9anWw6cJDtnhY=; b=eliBEWSmx6RpM//5+ktpLApfWia9M7zKzTRokGcqJ37ljz69OgxbXtO8sTUyM/CAymJUqH O3Toow2VBzcKJyUycT6KSzFSeP3bCss531/D9Pd0ycQN6/7Bt58T0/3YpIrgk0KXKmXGz3 2ZqMER7mIfYT6xPSu1EKfWaqaDxIvOM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="L8P4/+OW"; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662071717; a=rsa-sha256; cv=none; b=YxAJfPx99AJ7Mn0ctgRMckAXRtiKHny2hBfWRjQKcyk9ySrhOTIQGIsfG42OIq19OE8BRH 9cCilADPcWe5tZrGir9cd6vq03F7BCYqOMkrCnA4gzxxQy0GRkpZTH9khPMzXkFcV64QSf lCK61dK8Orddr1JT2BZgSaPMYaUyk2E= Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="L8P4/+OW"; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Stat-Signature: a5nb47mmsau8bkt34mka8nutats8r5b5 X-Rspamd-Queue-Id: F3F4E180043 X-Rspamd-Server: rspam05 X-HE-Tag: 1662071716-715507 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 Thu, 1 Sep 2022 10:35:59 +0200 David Hildenbrand wrote: > The possible issues due to reordering are of theoretical nature so far > and attempts to reproduce the race failed. > > Especially the "no PTE change" case isn't the common case, because we'd > need an exclusive anonymous page that's mapped R/O and the PTE is clean > in KSM code -- and using KSM with page pinning isn't extremely common. > Further, the clear+TLB flush we used for now implies a memory barrier. > So the problematic missing part should be the missing memory barrier > after pinning but before checking if the PTE changed. Obscure bug, large and tricky patch. Is a -stable backport really justifiable?