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 4080BFA3740 for ; Mon, 31 Oct 2022 09:36:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2FBF6B0071; Mon, 31 Oct 2022 05:36:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE09C6B0073; Mon, 31 Oct 2022 05:36:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A7DC6B0074; Mon, 31 Oct 2022 05:36:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6F5DB6B0071 for ; Mon, 31 Oct 2022 05:36:15 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 15122120C1D for ; Mon, 31 Oct 2022 09:36:15 +0000 (UTC) X-FDA: 80080738710.29.7483CE0 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 8D23EC003E for ; Mon, 31 Oct 2022 09:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bxaXanzCK5s5WMid8SsAWh4v0zGZpC2v88F/mTk9F1Y=; b=RCTQRQKD2T0TcniEhET7BMwfkA sXECeq6JLqIvHMWaBnkHW4SyBMUYHPlTNPwxOYQXxVj/Z/tYMEe0kIcleO4fFEs+qY2svLZGXW7tV FhcVaWZR4y/f6QUE4idiNq7QVlFSpUYYPrCN6GMbtdx6Inel/mQc4v/qUeFLv2Hpl5HLj4gQHcg+T dDXGzgvAk0iNPwPItNQxKX1uobZedI+g35a/Qr9SU5oVCuGniH3X0HXHrLN1IC6NaEaEUKQo77l+g s/r/oIpw9NVhZIPvxKMyh96MFtu785GRh9vhnZBL/sOSVaO8/ojEQf4eDlyVo3Pje8MPH/eO12UjG VsGMqGIA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1opRDK-003YzU-4I; Mon, 31 Oct 2022 09:36:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E717030029C; Mon, 31 Oct 2022 10:36:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C9CB62B9C2AC0; Mon, 31 Oct 2022 10:36:08 +0100 (CET) Date: Mon, 31 Oct 2022 10:36:08 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Nadav Amit , Jann Horn , John Hubbard , X86 ML , Matthew Wilcox , Andrew Morton , kernel list , Linux-MM , Andrea Arcangeli , "Kirill A . Shutemov" , jroedel@suse.de, ubizjak@gmail.com, Alistair Popple Subject: Re: [PATCH 01/13] mm: Update ptep_get_lockless()s comment Message-ID: References: <47678198-C502-47E1-B7C8-8A12352CDA95@gmail.com> <140B437E-B994-45B7-8DAC-E9B66885BEEF@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667208974; a=rsa-sha256; cv=none; b=KZWEtkLGWGRJgLJa6o8b6c/BIILvzqwrW6veyjwBfcWkDHRIg7GvTLp/tzEAC/LAOcBxHT MguTXnt19oyVgG0U0fetmKV8HZhusAnXkcWbqCIlEUxpORrcetrC3/b+1KXE9PrC1Si3ML QJ/ChwOusb0OAetYG3iLg/4iVdY2u2c= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RCTQRQKD; spf=none (imf10.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667208974; 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=bxaXanzCK5s5WMid8SsAWh4v0zGZpC2v88F/mTk9F1Y=; b=UoviuISP/TKPlOtp+xGh2j2rY6umTj74Qcr/JF3Y4aIArRf4K0ozOlCa13R5cpb16KnUbl QBh3bE1RGi/ZRiKelzhokdOH7m6G8RJ0J5PKaDB4jnHQVKdLk3hQ5Lv7Ve8LNUJe8yUYUG Fglhcnd1GFlyQkz8hdVF+3qzs6eUAWw= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8D23EC003E X-Rspam-User: X-Stat-Signature: azm37uis8w48zsjuu6m8j875rz5gnr8y Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RCTQRQKD; spf=none (imf10.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none X-HE-Tag: 1667208974-510881 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 Sun, Oct 30, 2022 at 06:47:23PM -0700, Linus Torvalds wrote: > Also, it's worth noting that zap_pte_range() does this sanity test: > > if (unlikely(page_mapcount(page) < 0)) > print_bad_pte(vma, addr, ptent, page); > > and that is likely worthless now (because it hasn't actually > decremented the mapcount yet). I didn't remove it, because I wasn't > sure which option was best: > > (a) just remove it entirely > > (b) change the "< 0" to "<= 0" > > (c) move it to clean_and_free_pages_and_swap_cache() that actually > does the page_zap_pte_rmap() now. I'm leaning towards (c); simply because the error case is so terrifying I feel we should check for it (and I do have vague memories of us actually hitting something like this in the very distant past).