Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1018080rwb; Wed, 16 Nov 2022 10:44:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf71ZlWTBZtFb42x7S2wVhNg1hds2cK6eqGTlXwyqW3CW1doF7KJNsyiQBsA2Yl1j8nQiVq4 X-Received: by 2002:a17:906:5f8b:b0:79a:101a:7e57 with SMTP id a11-20020a1709065f8b00b0079a101a7e57mr19136747eju.368.1668624296161; Wed, 16 Nov 2022 10:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668624296; cv=none; d=google.com; s=arc-20160816; b=lupLfEFHbqFzDxFYheEXFdoNL33GE95L36fxSnGPMu0oqoK4hwbU2STI5a4rqiTz2l LgukM1QPmsJ0boerfHUg/Tl2hoJU0KUGwYco8TM8c6cqw4BvonXeGZN6EwmyZCwlrGrK LlFhzrnqiYVh1UUqgnLPN7EeFpekbYCfj7tFeTp8EKBfrc7dRcWeqqRLh3xZtaXTrMs7 5q+6H/JT2Vw9o2Vh8CFxrQt7OCvj/rJofBTiRgoTz8P9J3kWxkmoFhR5ARMOx9aPhg1Y vGWFnyENpsaZ86F/DS5aXwqNbpH/8xDV7N+qfA8QXuqepXmoxSZuiEcVipfOZEMVjI7y iYEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1rQlgFzU2D6ccCofT8yfeItGDtrcH6vIuVi43kZTTr8=; b=NBNzEHIb2OY4dZJn0+LJ9ovtfj0YrlEQBXlK7FSM/XqbLo3ft5+OngizXq+/O0A2Uu H7Yj/pNt9nV3GwfmIWDqhZu5lJOI06az1YLw5tAu9mnwsLmPUAbVvKCZ2x7xlNgxYb+7 3TGVCpu/w+C6jeN8G0oGvAVg0b6gXmrqAX9SzQsZlU4lAj2bkcGL/AEc9ct/jBQEUKqy 21q/yEe5Rw2gCCcNhlQ8uFJwI79kNlAPpe+7JP27/EnUF+HtbzoW1uU/ti1WbrM4r+C+ 3E6+DNn6KTHTgflfRlJQBMpOn0Q5dakMUIzpgQH+uY/UG/AgLsXMir5cNAT2j3Boq5jc zxvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Rqi9C17f; 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 n22-20020a509356000000b00461b2c460c8si7906674eda.531.2022.11.16.10.44.35; Wed, 16 Nov 2022 10:44:56 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=Rqi9C17f; 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 S238846AbiKPRw2 (ORCPT + 90 others); Wed, 16 Nov 2022 12:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232855AbiKPRw0 (ORCPT ); Wed, 16 Nov 2022 12:52:26 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7429061745 for ; Wed, 16 Nov 2022 09:52:25 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id i9so12145082qki.10 for ; Wed, 16 Nov 2022 09:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1rQlgFzU2D6ccCofT8yfeItGDtrcH6vIuVi43kZTTr8=; b=Rqi9C17fStbxaE75fZDvem3v2dLunYE4NE3tLK28TY10XqKeNf3Xz1E7cNS6OeKABY 65XciY/3lUHieUdDbDB5CibqglDw7GoDSg59vGUg9ul1GxVmTB/tpic1yFlzTIDUWcvb BtKVUF4ZBsYaHfnluSbyDfJ0PASTdJPickmoI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1rQlgFzU2D6ccCofT8yfeItGDtrcH6vIuVi43kZTTr8=; b=TJxvrCNhrwsRps3LV1Xsmc3W3YFd/MzmcnpyO59Fm+152j7SicVJPu+JyMMQYzEJFB S7ufyZYHqXNlwGTQD8XtX74MCGam/D3l8WhmRc37G1rC7TJrYmuCn74m88SOdr6RKJSh WlhlOuEjWr0MAmxzFkLcWK4634U9KePawolHkHBCmcir0YXEncD14ne0DST/tE8s8Zt3 6kU/WwqN3OCQujrN+jaVHPCE3xbA5F2oHjYi6fruKCDZSuAQ+GBRz9q4fi7Wd+uSRlom u/QTQVCfkrfY4yFyg6mwNfjxZyBfCW8ywwG8Wywe0Gf0aNAuBm6hcuOB4NhtXUS0vZQm tJLg== X-Gm-Message-State: ANoB5pkYjSy7ovJYczk/ryALyQUy/ooTkyPKUPkTAi/Mot7EyY9Ckbp5 g1VqEKNTbTSOQTolcSKS8j59WL0xb8TPBg== X-Received: by 2002:a05:620a:1d0d:b0:6f9:c2be:a89 with SMTP id dl13-20020a05620a1d0d00b006f9c2be0a89mr20403028qkb.437.1668621144311; Wed, 16 Nov 2022 09:52:24 -0800 (PST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com. [209.85.160.173]) by smtp.gmail.com with ESMTPSA id s8-20020a05620a254800b006fa16fe93bbsm10465663qko.15.2022.11.16.09.52.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 09:52:23 -0800 (PST) Received: by mail-qt1-f173.google.com with SMTP id s4so11179528qtx.6 for ; Wed, 16 Nov 2022 09:52:22 -0800 (PST) X-Received: by 2002:ac8:718a:0:b0:3a5:122:fb79 with SMTP id w10-20020ac8718a000000b003a50122fb79mr21752516qto.452.1668621142404; Wed, 16 Nov 2022 09:52:22 -0800 (PST) MIME-Version: 1.0 References: <20221109203051.1835763-1-torvalds@linux-foundation.org> <20221109203051.1835763-4-torvalds@linux-foundation.org> In-Reply-To: From: Linus Torvalds Date: Wed, 16 Nov 2022 09:52:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mm: mmu_gather: do not define delayed_rmap if not used To: Alexander Gordeev Cc: Hugh Dickins , Johannes Weiner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nadav Amit , Will Deacon , Aneesh Kumar , Nick Piggin , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Peter Zijlstra , Gerald Schaefer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Tue, Nov 15, 2022 at 11:51 PM Alexander Gordeev wrote: > > In cases the delayed rmap removal is not used (which are > currently UP and s390) skip delayed_rmap flag and make > the related code paths no-op. So I'm not convinced about this patch. I particularly dislike adding even more #ifdef's around the data structure - it already is pretty nasty, and it was hard to see where things were initialized. The only actual code impact of this is in tlb_next_batch(), which tests for "do I have delayed rmaps pending, in which case I won't add new batches". Everything else is already either optimized away, or just "one bit declared in a structure that already has bitfields and has room for several extra bits": And that "I need to allocate new batches" case really doesn't matter anyway - it's not even build at all on s390, and on UP where it's there but technically pointless to have the test it really isn't noticeable. So the previous patch I was "this shouldn't actually _matter_, but it does seem cleaner to do it this way". But _this_ patch makes me go "it still doesn't matter, but now this patch is actually adding extra infrastructure for the 'not-mattering' case". So I don't _hate_ this patch, but I think this actually makes the current mess wrt our 'struct mmu_gather' worse rather than better. That structure is already a pain, with horrendous initialization and different bit-fields having different lifetimes. I'd rather have one unconditional simple bitfield, than have another bitfield that has conditional complications. Linus