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 7B6B5C02194 for ; Wed, 5 Feb 2025 13:34:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E7A7E280005; Wed, 5 Feb 2025 08:34:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E2A13280004; Wed, 5 Feb 2025 08:34:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA3FD280005; Wed, 5 Feb 2025 08:34:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AC353280004 for ; Wed, 5 Feb 2025 08:34:39 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 48A6EC0D5E for ; Wed, 5 Feb 2025 13:32:42 +0000 (UTC) X-FDA: 83085980964.10.7F3CE57 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) by imf28.hostedemail.com (Postfix) with ESMTP id 6085AC000F for ; Wed, 5 Feb 2025 13:32:40 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=erUc1bo6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of jackmanb@google.com designates 209.85.160.171 as permitted sender) smtp.mailfrom=jackmanb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738762360; a=rsa-sha256; cv=none; b=dx4Puus+pRkb5jyT4T1vuEqupRy05fUAmr2HeMXQqhDqt+9VTSIj2inDhZcezGWAq7t1jQ MyMKysgjMaCg9xSg5mmn59Xx3F07Nlm7EKI0sfxt/QPx7ruACm6Nglm6z38pkOc5+I+dYf 8kxCRuvYLdVLT84G1otgcd7/UNKN+ZQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=erUc1bo6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of jackmanb@google.com designates 209.85.160.171 as permitted sender) smtp.mailfrom=jackmanb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738762360; 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=W9kAqRKdmT0J+w11JZE4BKY8y4Rkzsz7QVaD81c7qRA=; b=KrHEDi75vtGopGw7CnZ6SF7/DGUXIrWp2aYin9SMTHSpEAcOppr0THc4CJWnRw+AUTAXBg 0eGpKf0UdjYV+58glYLDMpBEOiH0MZ1mc3jhCfCEVFqk2ypzngxNFkPrymrt6+YkA8KB6N AwsYyo/V+elO0Lo7sx3ZJexHBuXWX/Y= Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4678c9310afso516311cf.1 for ; Wed, 05 Feb 2025 05:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738762359; x=1739367159; 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=W9kAqRKdmT0J+w11JZE4BKY8y4Rkzsz7QVaD81c7qRA=; b=erUc1bo6t99ZhleeXtCqrCFdiEnkJfocr6vTJz6At0TsYyqQx0mBhEzLKk7YX4NtCL N2b7Xs0rZscfkgL5zRd1BvIJstcYqpXQCBS/Vkw3CnDg8PKCHQX2QJ6N0JGCXfhZgGDq nWW6no9BkxO99yLqlYpscw9L598v6Czqgw7MXTc8Ux+ZEHIR+U6MXPDH8jx9dBooNNcU 5p+JFc+tPzdUG4/qlaHrS6cIvnjSF5Nly1QjT4nL46xC5lNlOUGSnlE5Xmb6m2Z/4IHn GLSurJvO+ElGFDhj2SPl0a4dRZIFTP/KKRPz4Nzp9H0nAmVQEmML9XpR+AbYGrjTaFrV O6zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738762359; x=1739367159; 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=W9kAqRKdmT0J+w11JZE4BKY8y4Rkzsz7QVaD81c7qRA=; b=Czzb+EV7WWki8FBfA8MEA1o8ddaU+yVhI5TxmhmikK0cl9VmEEXI98n4rriCxlmffB 0gGpUBsx81nPC7kiztUlfrLXDF8ZSNWyQsApuD4YBGflRtkjUIvMDR+xoD5+xdVmJ1zO w5MNln5dwB27WozfP/tCRCboZAKwpB39k1SZn7R4zN8dl0X1x8YKCvsAptgc3NJ0tgn7 kHEm2+U8nAm+f+DYirhSK8QbyBDei6X8H/tybkljtHVChqjAMWN7s/nW/3zQqvhBIkfM U6mnUc56E4D1Iy+w7hS5PqXeuMF79SdpbxQLThtQuYj/Ry2FlR9HKpuVvuU/4UM/g8qt fhdw== X-Gm-Message-State: AOJu0YwZE6vLaH2d+lOMg/KORIBBWE2GmHDPp1ZAOPTynQFIAYB7epNR qe5TFA8NCtWcH/aNvK8O/BQMLfIKAhwdyb6kqMCcbAdgaI3fMGSyup2wdbpbOnPo1uCGaiVALPG QyK/jJVFj6AHv4o4c8grOwAJRsW4TUbOhDd0k X-Gm-Gg: ASbGncuEeEgYTAXsReiwlJOHGep5S/pJzYr89uY4qVwibcb7yFOUT3Ab0Ic2WCfqpwH Mv7NS+WiaUUw3N15DleqEaK1BWy4e1guVVzRm+PDFJo2Ac1JCmUfpuxQbYYLlpQcWoZzNAysq4z LbPQldMCzQZ5QRvvG7hVitCGl1uzQ= X-Google-Smtp-Source: AGHT+IHRdH1Yj5tdRHmpUFuC1AKWU5e2l0muZVmD705KOzeP+OUPIQemtIb6M/RoRyhOBnhrhELZj5wvFHg4dfIKC3A= X-Received: by 2002:a05:622a:1a13:b0:46e:1348:c6b9 with SMTP id d75a77b69052e-47019038fe0mr8755981cf.4.1738762359369; Wed, 05 Feb 2025 05:32:39 -0800 (PST) MIME-Version: 1.0 References: <20250129124034.2612562-1-jackmanb@google.com> In-Reply-To: From: Brendan Jackman Date: Wed, 5 Feb 2025 14:32:28 +0100 X-Gm-Features: AWEUYZns9Y_PL9_m121hyHA__cgsSH3kne0NZbDJTwiSEYquSXBeUwI_FRiXWNw Message-ID: Subject: Re: [LSF/MM/BPF TOPIC] Page allocation for ASI To: lsf-pc@lists.linux-foundation.org Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , David Hildenbrand , Vlastimil Babka , Michal Hocko , Johannes Weiner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: 6085AC000F X-Rspamd-Server: rspam10 X-Stat-Signature: d4kusfmzmxz4tzxxm7tpd1x1ig8yppp7 X-HE-Tag: 1738762360-4115 X-HE-Meta: U2FsdGVkX19MATOEHeQmRzmQCtSpEdh1VHjd63VYRt7f43CC3aBpgnul+1VvqyhAO1Wjw5sw3mEJXRtLDe2ccoLHxm63uyTqaLBBqpFMbZrNu189PsXg7hhpccDJuU2+IMsdDpPf2+JihotcwXCY9sm6sDfBrMsx/Ke7JC3tioy/qjgurEfFfs4biZRtWYBCGxyYIDrz2w6BkNxTScIbqgXoBtuOBWy+qrGS2cKg/i15ke+UXvT6ZHtxscAleKZ/Q4sn3AlY6yqG8l9R13VssQC4CIlmGZ/kbbd6Ks20D9fG/8I7el8Q294dS5LIOblIHQRdL/FwJwXL23x325fCURrzDVmaiwTKpEFkxmQl+V56KMIAXLvLgnwYCQ+IuYh7T2ZC69eCJHddNQ8CsN5tsY6OpEok4J4pXKFX5gIMHewyL0moMlyTO7TycCah1PCDhhbnLkoJJVQly/rwZ4UQ5RhgA5Nayacj6gjUEVzn6cYUhFqCj9C12ph1bQFPLvUQC0431CcRr+qvUEBvxkNIEsx53Gqp6YM6Lm4UquTKD0aFetIVqEUfsn933Oa8xkR4hTGAK60WDvN1M+Ym3VU1JaAtEPyI8gDg1twgwpcpNzf15/S+qayfSyftNzYoSdr8Oa1/uVs7wzQhhE2ds+QJSr84TOP0cPdF6yiXmGBdVS43zlNehl5TOewOTecW5gjmwIJ9qicCpPdb4PhpiNJXRfN2jz3X9svFLa9T2Pn2KA1hWbf6Eo+OK4eTIU46pz5LSxDN15OZtMOi+Vbv3Pr/gz1RTmvwpyr7yV6/YNpOn36VXjbfjGJTcxKNWgMHZcL3tnhQ5YZfD2zW+m6zgfeQnte82v7MK3A9LK80VpeU6hvxqsoy84h+xugQ3OnGy76w67jbrK9zmgLDfqDIkBCadl7+hvkjB8UjfShXxDhvYUpaEc69q1eqVdAH51I8IpSBpUDihEFbieqKcTIsIL1 DgByaeaD SIx74Yc+LeemGITXySrPuggdNvCLwgRQ2zifo1QPQZmhqjAgz+pMYvXPXP77YbjAk9hQlkEk3LX/zlFG7enSr7Yylys1Rhyav2sEL5tidwN52DUzCVOnc32jx2dt0LFmB2/VENOgSBlNU7LMfKJp18XR0FdrW3hvBL82Xv5B7V8niJWefDCLmcnm5kexcC32sRefpkFfuq0pqsmCNmJCIlmWPVw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, 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, 29 Jan 2025 at 17:35, Brendan Jackman wrote: > > Although we=E2=80=99ve been able to hammer this approach into a viable = shape for the > > Google workloads we=E2=80=99ve been concerned with so far, it=E2=80=99s= not a general solution. > > Some concrete reasons include: > > > > a. It leads to pointless TLB shootdowns; there must be pathological cas= es where > > lots of pages get un-mapped only to get immediately re-allocated and= mapped > > again. > > > > b. The asynchronous worker creates CPU jitter. > > > > v. It provides no ability to prioritise re-allocating pages with the sa= me > > sensitivity as prior allocations. As well as TLB issues this creates= page > > zeroing costs as pages that were formerly sensitive need to be zeroe= d before > > they can be mapped into the restricted address space. > > > > d. This all creates unnecessary allocation latency and extra work to fr= ee pages. Oh I forgot another important detail: this uses a pageflag to track whether a page is currently mapped in the restricted address space. That isn't necessary, a proper page_alloc integration should get rid of that. Anyway, while important it isn't the hard/interesting part. If we got really stuck on this point, we could probably always resort to walking the ASI pagetables to see if the page is mapped.