Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1949249rwi; Thu, 3 Nov 2022 10:49:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TKFsOuQV8MMmx5ie5Z0tcLftTOEVdjkRMq3T6jxbrrAgqu549C5gVz5MA0lGYHz6bTmnQ X-Received: by 2002:a05:6402:1d4f:b0:461:d2ed:788c with SMTP id dz15-20020a0564021d4f00b00461d2ed788cmr31463579edb.418.1667497776111; Thu, 03 Nov 2022 10:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667497776; cv=none; d=google.com; s=arc-20160816; b=p6bN5dLRDTucxy4I0ivKT18+N80O/StmUzYgLfTweJqV/wgDRCETnHsfPQkXUM4e8s 64x22/Fsc1k71VLuXw7jaULYdajKKXFb5++bnuoE2a6DpRI8NsF4zQtDh21Z4JJFZ6q8 FM5aNAyKiX1qzlwmr7DrQWaV9p+/Ye/M/o884IrXGq7Y1OgjoQyT1B1146fXfmlBSrCk K5BxENuatT3HFNoHZCWqon9aU7tvm5NK06qUjv9K+LepdorRx74jctFE2cUppchhwIbc GKjuI/HkFmh0CVoZuZuzUrG4pg77GDIJJhWBWWFCqPGZMmmmBOHgkkgAo/J3sNbCCM71 gvyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=wqHDCfVM36OPNbloym/8DLeITW3uuDn/ofViGZw+9QU=; b=SwqaZKe+K2PqCoKHkT20Py3NRT4ExSA2k1EZLlW2KYg1ML7ndGQXxCmbBB60ZO5aqb uPDrrUJr5oZq1J29kBBJo42JSa6HeZwlYc2wyDLep2tevycJqX7WLnp7cdG9fAma3lEu vfTLlF8MQ3TnNgqgMcbGfsI6XKwujHvvG+5abgeR2fku7aAxpqbAqcLm0To8E77cCI0U EOf+XwMCmWwUx64YzPm+YBGVaa95gpdmNO3BEt88gLNFHK2+HIKuUkI/tRBbim39mmGO QliMhbVHHWzf+8HpLendB2xvD9BGYdj4Sja8VD0PsWPyzed1RJakmP7NzVjmT1EznfUK K/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SH/G1phm"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r1-20020a170906280100b00780a882d337si1717177ejc.480.2022.11.03.10.49.12; Thu, 03 Nov 2022 10:49:36 -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=@redhat.com header.s=mimecast20190719 header.b="SH/G1phm"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbiKCRhP (ORCPT + 97 others); Thu, 3 Nov 2022 13:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbiKCRhN (ORCPT ); Thu, 3 Nov 2022 13:37:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BB3426C2 for ; Thu, 3 Nov 2022 10:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667496974; h=from:from: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; bh=wqHDCfVM36OPNbloym/8DLeITW3uuDn/ofViGZw+9QU=; b=SH/G1phmFNnPBezQWLEXBC8Du32QWja8MjyTbMagOQKpkXZpf8lQkei0RTI3ubrJUcJM25 NCOYowp5lpoDNX8dihUbJcbnNkJ6zvM9j1eAXi6caPX3asSDRRpqBJ55x+BlwoZ8u4aKNu QCbbwhcPK1IPLVyA1X3SRb4jU5kehuQ= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-28-BLUf1PFaPjqy07aspd6EsA-1; Thu, 03 Nov 2022 13:36:13 -0400 X-MC-Unique: BLUf1PFaPjqy07aspd6EsA-1 Received: by mail-wm1-f71.google.com with SMTP id v23-20020a1cf717000000b003bff630f31aso769911wmh.5 for ; Thu, 03 Nov 2022 10:36:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wqHDCfVM36OPNbloym/8DLeITW3uuDn/ofViGZw+9QU=; b=G7+yrW6Pajz1Un9NmXBdK2nhrPS51YdlNErq6OpqWe0fUypdDDB+SG0Zf0S8lFBgaA Vxn6700fj/IwLJYHr0kHjNiSwMn9+/L+zjdXRmRT3CrktqNUofmTUmH9pel/rKYshnjy kMdqOXq46GQZ9J01DUGpsJ75oAPDTRShPWtZ1qVc4qGgfKk+jZiqN9jXjO/6eZMdAW9q H/U//OxRD/u2qDWyCDLBA3KbYTZm+yVwlRaNB3jg9mp+E8+OzPzlYZepIoJVm7u73OVq oJpTKNoZOzV2f39g1i/q9wrRBI0+1iTLo16dZ0RYSUAdvITXyW+h3TcJAeMBluiV34WO F/cA== X-Gm-Message-State: ACrzQf3TnTmxxyXLVW67l6I8Q27EHI1hWfpx0DwSdC6aORoEK4Xuazpr DY++HhK3aM9s+dosyVrSb/vduG7it3qxsBdlcQdulc/lE04soUrtlTXsE8ORpiGwGgsMxQSUTAQ fCw/z9012tEZbYByXlpCqZT3y X-Received: by 2002:a5d:4c43:0:b0:236:547f:bd3c with SMTP id n3-20020a5d4c43000000b00236547fbd3cmr20124907wrt.380.1667496972001; Thu, 03 Nov 2022 10:36:12 -0700 (PDT) X-Received: by 2002:a5d:4c43:0:b0:236:547f:bd3c with SMTP id n3-20020a5d4c43000000b00236547fbd3cmr20124874wrt.380.1667496971580; Thu, 03 Nov 2022 10:36:11 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:a400:e2d7:3ee3:8d35:ac8? (p200300cbc707a400e2d73ee38d350ac8.dip0.t-ipconnect.de. [2003:cb:c707:a400:e2d7:3ee3:8d35:ac8]) by smtp.gmail.com with ESMTPSA id bq7-20020a5d5a07000000b0022e035a4e93sm1379834wrb.87.2022.11.03.10.36.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Nov 2022 10:36:11 -0700 (PDT) Message-ID: <3259ad30-c129-84fc-9643-0aeaeeb3c806@redhat.com> Date: Thu, 3 Nov 2022 18:36:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: mm: delay rmap removal until after TLB flush Content-Language: en-US To: Linus Torvalds Cc: Peter Zijlstra , Will Deacon , Aneesh Kumar , Nick Piggin , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Nadav Amit , Jann Horn , John Hubbard , X86 ML , Matthew Wilcox , Andrew Morton , kernel list , Linux-MM , Andrea Arcangeli , "Kirill A . Shutemov" , Joerg Roedel , Uros Bizjak , Alistair Popple , linux-arch References: <47678198-C502-47E1-B7C8-8A12352CDA95@gmail.com> <140B437E-B994-45B7-8DAC-E9B66885BEEF@gmail.com> <4f6d8fb5-6be5-a7a8-de8e-644da66b5a3d@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 03.11.22 18:09, Linus Torvalds wrote: > On Thu, Nov 3, 2022 at 9:54 AM Linus Torvalds > wrote: >> >> But again, those changes would have made the patch bigger, which I >> didn't want at this point (and 'release_pages()' would need that >> clean-in-place anyway, unless we changed *that* too and made the whole >> page encoding be something widely available). > > And just to clarify: this is not just me trying to expand the reach of my patch. > > I'd suggest people look at mlock_pagevec(), and realize that LRU_PAGE > and NEW_PAGE are both *exactly* the same kind of "encoded_page" bits > that TLB_ZAP_RMAP is. > > Except the mlock code does *not* show that in the type system, and > instead just passes a "struct page **" array around in pvec->pages, > and then you'd just better know that "oh, it's not *really* just a > page pointer". > > So I really think that the "array of encoded page pointers" thing is a > generic notion that we *already* have. > > It's just that we've done it disgustingly in the past, and I didn't > want to do that disgusting thing again. > > So I would hope that the nasty things that the mlock code would some > day use the same page pointer encoding logic to actually make the > whole "this is not a page pointer that you can use directly, it has > low bits set for flags" very explicit. > > I am *not* sure if then the actual encoded bits would be unified. > Probably not - you might have very different and distinct uses of the > encode_page() thing where the bits mean different things in different > contexts. > > Anyway, this is me just explaining the thinking behind it all. The > page bit encoding is a very generic thing (well, "very generic" in > this case means "has at least one other independent user"), explaining > the very generic naming. > > But at the same time, the particular _patch_ was meant to be very targeted. > > So slightly schizophrenic name choices as a result. Thanks for the explanation. I brought it up because the generic name somehow felt weird in include/asm-generic/tlb.h. Skimming over the code I'd have expected something like TLB_ENCODE_PAGE_BITS, so making the "very generic" things "very specific" as long as it lives in tlb.h :) -- Thanks, David / dhildenb