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 9A058C5478C for ; Tue, 5 Mar 2024 02:56:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2FC9E6B0088; Mon, 4 Mar 2024 21:56:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 284BC6B0089; Mon, 4 Mar 2024 21:56:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 125906B008A; Mon, 4 Mar 2024 21:56:44 -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 EDEF76B0088 for ; Mon, 4 Mar 2024 21:56:43 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BBB961C0ACB for ; Tue, 5 Mar 2024 02:56:43 +0000 (UTC) X-FDA: 81861472686.02.07E8D39 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf02.hostedemail.com (Postfix) with ESMTP id E086B80002 for ; Tue, 5 Mar 2024 02:56:41 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="q4dGE/2K"; spf=pass (imf02.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709607402; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+a/bGF67RrRMq/JJCQOD+w1zfeBPslpGFRIpJTwCIY4=; b=SMHgye/6ZBYgyETc3ePtoSruLZ12XTzo0l+TFttJwp+khbHhKgTxPbK+MXenNgzAWrYZe+ R5MxfeqPJ9p/f+t15WPRePTGvmO5PvVOhm416LYLQ06pJZHgcZQ2LCv0LgGuPwKbhcYj1H T6l31LimobkqAJlMdn7ooXsP/VClqqg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709607402; a=rsa-sha256; cv=none; b=RhedlhMsBgo0YB2AiTgvzb78LV3o7kg8Ep0tg/yVt1iZq8Bj0dF7EFh60sjjYyGNV7oFpP Em3To0JisAuj3BxfqZAqYS2gzdaOXbX/oB5Gx7XDRYfnLWARN19XLpk4+3m3IwqfRybUQJ nKGQZv8ZJlnyVM4JHUPm2p/Q/DLSRR4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="q4dGE/2K"; spf=pass (imf02.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a458b6d9cfeso106509866b.2 for ; Mon, 04 Mar 2024 18:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709607400; x=1710212200; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+a/bGF67RrRMq/JJCQOD+w1zfeBPslpGFRIpJTwCIY4=; b=q4dGE/2KrDLhxNZ2aobXSLqdZZE8J42jIfQABMrQD9Hr+dOCk00xmLTLDJAOV2oXjb QYaVtk/lQO7prYhgV2lO2jKw4Wk+8bYg4QaK6ckYGlIhy1h1KJMpx+sKsxeJ5uSeRDxj wkR9TaZksGDWmaDZ4zIC67dj30XKm6T8FfjT7vx7FNdq+1qj3L//tt01QdUbIzpIM6gP 9VhIYaZnmm8lUGchfY9+9cRDyfzxVVun39UuD2B6WglQQtML1QvgCLrF77t2QALICAAs HAUu3WcmAXjUHCNLZb7v0P38Bi6/c8GKyAZftZwhoD63bGAkmH6UDmgdokHzDoS3cKV3 HDEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709607400; x=1710212200; 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=+a/bGF67RrRMq/JJCQOD+w1zfeBPslpGFRIpJTwCIY4=; b=pXTDpYKf5VTxVtpIJEFFMRp0HBf0eyntQWM8Ue6VXAA3trZZVtvdcAakya26Pj9N4b JPLDM9XiVn2vQBN7U+sSMpBSwT807XMKShFz0btGEYaq/Oj+MebW5BsmPW5RFTgrVBvk OFU3ie86UbtKDA/pOrQTt5bLUa4LWvDonyeCjiwAq6qQBwjdcBLQiPv116SjNO/e7GWr 7xmeG64EYgyIOOUIgsr9BJreTmE2bOzI2U+Ekq94zYVv3f2+p3PATGv41ooQpgpE0Pxi ZyyU9VyRBAVD0zGjSyEG59ollLEvyipgAQ46bESVKvVBN83Zt+nT0YBrE1w+Bxw5HMr5 dGdg== X-Forwarded-Encrypted: i=1; AJvYcCU1QdznmkVOZ8oscJTpe+QzE2KrbD79ZSmc/e/QGQSZZkDlIjEVT2HMVn/fxll00HhFdGtVnBVElxRX0ea3qFQJBSo= X-Gm-Message-State: AOJu0YzRkLwRYrJe+Tk6PCt+maYSTwXQ3f+5+QrpuGHv4pQLeMzSUFgI +6MPtEBOPIZTzyP157WKP8TU2/IOnuIMfPv4P676vcKZ6eshBScKRVqIFZ8P/U5pAAFGbiJMLvL Og5k4buMYs9jpA2nVWf4d3s+U2Txb/OodUSoE X-Google-Smtp-Source: AGHT+IEIgWXWVlIkMLWUnRUlc/2I1/rqfquInSautNQmo/qXB6Oh3m/iRLbUOiWj9p8n8RIRlXKQ1Yj+9lYKswa/KdE= X-Received: by 2002:a17:906:e1b:b0:a43:2290:7689 with SMTP id l27-20020a1709060e1b00b00a4322907689mr7096674eji.65.1709607399891; Mon, 04 Mar 2024 18:56:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yosry Ahmed Date: Mon, 4 Mar 2024 18:56:03 -0800 Message-ID: Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Reclamation interactions with RCU To: Kent Overstreet Cc: "Paul E. McKenney" , Amir Goldstein , lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel , Matthew Wilcox , Jan Kara Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E086B80002 X-Rspam-User: X-Stat-Signature: 8fx541dwcee5g1k41h5hhrna6nuctksf X-Rspamd-Server: rspam03 X-HE-Tag: 1709607401-870016 X-HE-Meta: U2FsdGVkX1/3t1lsqqoByA+N2KpGzPA5FCxy86P3V1zjF7ANZ7x7in0fnabYPI/j7j4d+Mf3Q3SoTWlyaU57SJ9PM4H7FiV+4g42fUGVpNfFZbe33X39r2gCPfIRUMMk60lGTQk0kothgQwapKn127lgonqLkY8CkBVMhEx0DbBpJDeMFWSB4T4t7UZhBXywGZFI463mlAi4Mzy+hB1g7/1DBnR06anQerhKkEszrV0/B3APF15jFXnXU6ti4TdR22aYIc8J75Mmm0NDmFNwFGSswiDz8rl1mhBUnzUr0RHxv5SaqQF6I82GQua3JG9XJpPuJwtkeAaz+ajWlI4VSpl8MjTOeAmuL8xYBu91lvHHY0wYNJbCLZIJ6T1sByP/JjIodKzLrdsfiOXmuvq+opl/0AhkrVlV3ITbjCX7pqmYqlOQVQfLjCVn6EWAdxiKP5dOGXnoEHPH/K/Lsid7KS9NuHPm/fGa4bKe/2XHMYSoORxJrGg8mPlq6vRyjQb5RAWjfS4unxr+SwwQbBnSg1ojIl/vhje/Kon6w0F2rWwDcoMYCpIXJWhHzSHPi1KQkFZM1Uifi+mcf3w0JOU4cxqI1u41Umm/+KGRdkN54tvi077g9O4YC2DVapc52OSwnR4nWDpzR5RDOpI8I7kWJ54+QsMgKV5VZZr7F2nYqFAppC7VxHQwrswDT4bkT8z6KhwZ7qO7Gn2gFdX2qkHJDQD3YfG3cBJ3P6m2LBFEalSDOBYcoTUDSX/kBLy9LaCpLK8dJ9KAOdqnPhmbjpojcJK9DEgLsFzdVzoAd8l7wJzHJb83z3N5446b526hpYJLNoLxmi/WMUK1AGrb7B7AFujGWnwKgvWohptKhTvLmR8Ffn/UhCJvJPcbF5ZYATOVjehkz7krIyw3BJxBudUyI5Jjjw3CH0QWJ0iYK/LqaoyPdhcqOlEUMvlL+ztOr80rUgBAU2IScYQZqOJxvFQ nsDHnKh2 +C2ebPcAnjmaEK/xuAecXC7Fk8DZOZgupv+LNtQ09abRKwAsSLquLtdLdDIUNgjMaHdtKt3o++wEu4Ir4LKki2YQB9GuNVvDRHhipp1806fhgY/otNmo1fQFFnb5dReg87P1W7DRoOThovgIuV8dU3EehHXOmzrC7wn8iuywzO53cCqAbhvhDTI1m0T/+8b6zQEEWivCn/IbEBjMuiwkL2ofbnSvvyrs8XxVFW/zf+cn6qRuqNZL//KyRM32S7YZ1QOb5zrhOEJyoQ1nJ9nlyuVu8baJ0RFBqx2Af X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: [..] > Willy and I were just chatting about this and I think the conclusion > we're coming to is that we'll probably want to try just RCU freeing > _everything_ at first, the reason being that anonymous pages are > probably going to get included and that may end up being most of the > allocations and frees - so why not just do everything. > > Meaning - _lots _of memory cycling through RCU, not bounded by device > bandwidth like I initially thought. > > Another relevant topic: https://kernelnewbies.org/MatthewWilcox/Memdescs > > The plan has been to eventually get an actual enum/type tag for our > different page types, and that would be really helpful for system > visibility/introspection in general, and in particular for this project > where we're going to want to be able to put numbers on different things > for performance analysis and then later probably excluding things from > RCU freeing in a sane standard way (slab, at least). > > I wonder if anyone wants to solve this. The problem with doing it now is > that we've got no more page flags on 32 bit, but it'd be _very_ helpful > in future cleanups if we could figure out a way to make it hapen. > > That'd help with another wrinkle, which is non compound higher order > pages. Those are tricky to handle, because how do we know the order from > the RCU callback? If we just don't RCU free them, that's sketchy without > the page type enum because we have no way to have a master > definition/list of "these types of pages are RCU freed, these aren't". > > Possibly we can just fake-compound them - store the order like it is in > compound pages but don't initialize every page like happens for compound > pages. (Not following the thread closely, sorry if this is completely meaningless) Why not store the metadata we need in the page itself, given that it is being freed anyway?