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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3F9FC38A02 for ; Mon, 31 Oct 2022 09:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbiJaJg0 (ORCPT ); Mon, 31 Oct 2022 05:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiJaJgY (ORCPT ); Mon, 31 Oct 2022 05:36:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183526418 for ; Mon, 31 Oct 2022 02:36:24 -0700 (PDT) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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).