Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp429740rwi; Mon, 31 Oct 2022 03:22:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Zm7xC0uwdB9pkhLGVMM67QlfdvxI+hbytJCImfsMBQKYRxEnZ39GZBVU65UBq4bGtgjPA X-Received: by 2002:a17:906:974f:b0:7aa:f705:e580 with SMTP id o15-20020a170906974f00b007aaf705e580mr11592571ejy.530.1667211734111; Mon, 31 Oct 2022 03:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667211734; cv=none; d=google.com; s=arc-20160816; b=l7prDh2WFsBsSGdgdwgcofYAAo8g4ia1lxZPh+gmKUGmMMzzayjd3dTpruos7vrHvh aPfsyB2IIbEIoQS7OVXtG0Xn2s8GFB3SjIbAzvHZvVwSba/1qVdEj420oSUMBB/2KbRB HgBjs96ZKuwfZdvjTD3HlK9oZ35Mwo0/0ylTUD1PMy3eiQai9i5ITPS38efjz24rhYyI duTYhEt1FGNqalRRJsDgvbbvFANmyHBr+1TSlLw5ZtDFi8FvSEAW3Uh/0dMTdg2rOcFq 4XTYFaiONPfGKCWtjkaLbWQ7jVjMbCa+v12NoUr0/3oe71dJb49kJtEggG8V/k9ESNnF 6mnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bxaXanzCK5s5WMid8SsAWh4v0zGZpC2v88F/mTk9F1Y=; b=SUso7cRvv4P0JJqussSCSio3JW6/2RcunQX/UqB6o8MtrC0uoQbPilNubEb58G5iyc yTbucJgNaxmy3ILZBqdfAB+K3dDGviK4I7AmZ+N3/GxCE/Qm5b2INzT9aSC+HSuWjkC4 w8KZhlP0jcTRN8mHLPX2Q7SEhYVJvAAovBV5p5X3xsQ4NQwjfHFFueyX7gTmacCNTFO2 MRJ2VVxevecMft7to8xy0gwhOFtCsMMo47rxPxP2U0pVQwS87Rwhe23fLkwP6am01leL UGJ0dJUMrr1kSfd+ZLxBXdOBuTTGoOuML9hIC4lgpWSa9OEX/M84z9+bGA2drCP6ftO2 e5Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RCTQRQKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 7-20020a508747000000b0045e00384e8asi6516543edv.380.2022.10.31.03.21.50; Mon, 31 Oct 2022 03:22:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RCTQRQKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbiJaJg0 (ORCPT + 99 others); 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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).