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 AAA51C369B2 for ; Thu, 17 Apr 2025 14:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EA9A280064; Thu, 17 Apr 2025 10:06:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2961B28005A; Thu, 17 Apr 2025 10:06:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1858B280064; Thu, 17 Apr 2025 10:06:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EF46C28005A for ; Thu, 17 Apr 2025 10:06:41 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 77F091617C2 for ; Thu, 17 Apr 2025 14:06:43 +0000 (UTC) X-FDA: 83343711486.06.93DC4FB Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf28.hostedemail.com (Postfix) with ESMTP id 90EC7C0002 for ; Thu, 17 Apr 2025 14:06:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IYm1vs9e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of mjguzik@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=mjguzik@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744898801; a=rsa-sha256; cv=none; b=tUM/NDWUkA8KU6Sko9Vg3M7CwAlYxRVfu9luMaajgRdL0dPf+MWDwQsgtjTqjgGNflzrXv A/8EfLMIh3eLswPC9Z365HDb2hvhzVsZktBswehvsyfRA7/awRzwQuJlHy9QJNMIj8ZaCq 9+YgBARci0zI3n8v3a/qN6WL80b2u74= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IYm1vs9e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of mjguzik@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=mjguzik@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744898801; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8OFpMRgE/GOLJYWHzWMu2oFpPG6VE+EsoOydCsWR+Ng=; b=Mra137lQ6c+ouILkmbeL1ux0g1CZ2rIePCdmtYk3D8jbCCuV63lhvu4COAgCboR3jk3ihM APshuftkByuFK2EFQsSm56thLfPWIiMUHx9Fci/zQTsts8zrxeRxNG0WyWMHlqCcN3Yl2T 4tpgKsJzMzqN5i8i9gRX/QjsO8ZuEUE= Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-ac7bd86f637so370623466b.1 for ; Thu, 17 Apr 2025 07:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744898800; x=1745503600; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8OFpMRgE/GOLJYWHzWMu2oFpPG6VE+EsoOydCsWR+Ng=; b=IYm1vs9eHy00Nu52aMW0T4H+Km0cSX1TsL3nxeao98hSfSG6CG1C4iz0Mo2NQM91i1 JZiU+nfpYaGcWLC+S5nDJZDAbSO46cBhPga+C7cCpYs3nnT6nTD7JdsHuELHEUmhwakm JXuOZuEgq1x9mh9plBld1Cs0+k9sgEJIzUAiJ83551WKnq3xvu/MoJisaE0nN52OIdMd gLtdGj1rVXpXwwudIsgzuWaVSB6xd49L2slQBGD360Q2u14T8x2S5C7bAkBNR1LfE4R7 DoVnBLEhF7yvYJl718BfV6TgEpUxPopBgQmoDYUux9sYuF4LHZj2YkCc6jqB1p/zJmw8 4G6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744898800; x=1745503600; h=content-transfer-encoding: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=8OFpMRgE/GOLJYWHzWMu2oFpPG6VE+EsoOydCsWR+Ng=; b=dnm1GrOerqs2rQooqM/Cvx/PskVJbOPyoqGRh139AQf5CGlYvrChaZBJwPgweeWYxq 6xD9CLi3hzxUJPLCe2FVArW/ftiUOklk0uCxsOxFal3ABCSOB9R8e7XO3x6C2+70RgBC lAUc9Ns1nMyj0QVC74D9aoPT/hzOYY+pw4iKOz4sFjo4i41Pkj7CapSnZ/R6OgAfhDqH 05i6OlmkU1VeVsVKmz2CdjI1cNBvIvyYA2kXJwetwKfot2ua/+mt2mRcjouUSHLUlucI Q0ygGxbC/mxYjmB5MXD3bG8SxjDOXszRoUeYM2sELIdVlcdEiJsnrbVe5tpAw+8vc0Hj ZZsA== X-Forwarded-Encrypted: i=1; AJvYcCUHv8J09W6YT2+IMPNN95iYCGj6eqKH01CwywSGMi9kkbiaRQP3MRnvGXO3zAvAJ8Nb+CToUu+lJw==@kvack.org X-Gm-Message-State: AOJu0YzumguuDDFePrVvyZjTaE+tChdyy0xFXS7gvnaVbVFycyPQpYT6 4ngiUqh3vT+DMEvh6WCxt2wqdsMn1pPm5eUtyuLxwiJfXBklCEDJww3li732uZtuUhRGCM3l9WN I2ACmnBZOGI+dZjQies18wziFUbxyL1MfdF8= X-Gm-Gg: ASbGncvqG7OOozk7/UA+wl1YrsWFIzuJSX8j6b6thgycjQBtvR3sRpfXz61Qz1kIvc2 e8/OJ0lwP4mWmWMB28ASFCJRSbtirHN5K4JKjDJ9AuyQwFIjFLgW25fl70tOq2eJcDKSvy2eihw efi3YPaXWgv2FoQ/d+p2KrUw== X-Google-Smtp-Source: AGHT+IGsUHLegHbwuh6ly1Ke7B85R6Sq5HbaxgR7uzAALocC7Ub2/KubeJ+CVjVlTU0WeaZLQ3vptmxm0veo/pAIxH8= X-Received: by 2002:a05:6402:4416:b0:5ec:8aeb:812a with SMTP id 4fb4d7f45d1cf-5f4d1892b88mr2913661a12.14.1744898780950; Thu, 17 Apr 2025 07:06:20 -0700 (PDT) MIME-Version: 1.0 References: <20250414034607.762653-1-ankur.a.arora@oracle.com> <20250414034607.762653-5-ankur.a.arora@oracle.com> <87tt6pw11t.fsf@oracle.com> <87y0w0vhlq.fsf@oracle.com> In-Reply-To: <87y0w0vhlq.fsf@oracle.com> From: Mateusz Guzik Date: Thu, 17 Apr 2025 16:06:09 +0200 X-Gm-Features: ATxdqUGuMfLuHIG1RvclBhN96o3tjnFY5_NXY1N6cxDNZLe3EM1dEJcGhBhGGks Message-ID: Subject: Re: [PATCH v3 4/4] x86/folio_zero_user: multi-page clearing To: Ankur Arora Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, luto@kernel.org, peterz@infradead.org, paulmck@kernel.org, rostedt@goodmis.org, tglx@linutronix.de, willy@infradead.org, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 90EC7C0002 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: djeypwi5afbttbd5bhgwmqbby5hodoxe X-HE-Tag: 1744898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+W+v59Rvz1/4ax+0F2DWEsnoDv35AcHxhkoW0x6N4QRSVadHVnSMPjoqELo0qkHwMuUu/2K0bDuGaGmI0AfyuciRmbjqUh3PDhY9yMfTeLmJCnnXNmXgsHpnkqhhKXrAjstrQUShWTg4eo5DE9AqyPNNINc/nhO0WWe8XL6uC+SffliO5H6xUomotB26t86J0gKoW69IXLgaPYrRd/RTp14X32D/a1EwxZvP1FmoaMRyn2rK/z2jfyoSl5WgrhIEPcGCRWh3BmRf9Amdlw9aTPmZnotFIWbt6AGvunfea/Z6YR7t3EpZzGScwjmmIaHwvCpRofsosQfaIejMSwsCCp+quK6iydUlHiaHwMG2ugHH6puxA== 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: List-Subscribe: List-Unsubscribe: On Wed, Apr 16, 2025 at 6:46=E2=80=AFAM Ankur Arora wrote: > Mateusz Guzik writes: > > > On Tue, Apr 15, 2025 at 11:46=E2=80=AFPM Ankur Arora wrote: > >> Now, you could argue that the situation is less clear for 2MB pages. > >> > > > > Well I was talking about 2MB. ;) I thought it is a foregone conclusion > > that 1GB pages will be handled with non-temporal stores, but maybe I'm > > crossing my wires. > > Or I am. I agree the situation is less clear for 2MB. I think for the > immediate neighbourhood we clearly do want temporal. > > For the rest, L2 sizes are typically ~2MB or less. While there might be > latency benefits for caching the rest of the page, there are clear > negatives to blowing away state that was definitely useful in the > near past. > > Would be good idea to quantify. Not sure what's a good benchmark to > do that though. > L3 are not that great on many CPUs either, so you could argue you are blown away the real stuff by zeroing a 2MB page. I slept on it and I think proper evaluation is rather consuming and tied to faulting more than one page at a time: https://lore.kernel.org/linux-mm/CAGudoHGY012mwJqtGPUQ9mfQEVF1_otr9NSbbTYi_= vazS09-CQ@mail.gmail.com/#t I don't believe putting that effort in is a hard requirement at this stage, albeit it would have been most welcome. I think your patchset is a step in the right direction, even if the specific policy is to change later. All that is to say, I think this bit can be disregarded for now. I definitely don't want to try to hold up the patchset. cheers -- Mateusz Guzik