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 7222EC48BF6 for ; Tue, 5 Mar 2024 02:55:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 014056B0082; Mon, 4 Mar 2024 21:55:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F06A36B0083; Mon, 4 Mar 2024 21:55:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCDE86B0085; Mon, 4 Mar 2024 21:55:05 -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 CEC546B0082 for ; Mon, 4 Mar 2024 21:55:05 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 82DEB80AE2 for ; Tue, 5 Mar 2024 02:55:05 +0000 (UTC) X-FDA: 81861468570.16.5CABC38 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by imf25.hostedemail.com (Postfix) with ESMTP id C9B03A0006 for ; Tue, 5 Mar 2024 02:55:03 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=dijRMFXL; spf=pass (imf25.hostedemail.com: domain of yosryahmed@google.com designates 209.85.167.45 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=1709607303; 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=sAIg+K1FyMraMU/hEXtxnTmOqsREezzXahRBlOT5IeM=; b=A9zMq3/MYrXyvjFyNVynXqCB7qUws6qwFVOXB9n0JK3x9Ko0Vfwlz0BxaRDOBWY4g+v+Fh JvSy/53+XkdzGsv2F8aJfMkifLpVBYUXad7Q7x3ic7JhUgCQafRAYtxvZzqtp08Z0Hl+vU ZyZurjkmyk7ZKQ83K/Xtk+GbEBpft6w= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=dijRMFXL; spf=pass (imf25.hostedemail.com: domain of yosryahmed@google.com designates 209.85.167.45 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709607303; a=rsa-sha256; cv=none; b=7fcHIWdRj1975ExQuoDv3MMZjypPFf1wV2xVrAd92SrniTCl70hp6tg34T9cZqeAnE3hV0 GpiTPt4pEvHRXBTsJbV7g1pUSO31H+ODHjHByJcyyeeAC1qB9+Vvt3m14Ev5OQeZhtC4zp 1sYil2lwPy1ssjz4HfHmilS5z2ftCYc= Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5134f830488so724822e87.0 for ; Mon, 04 Mar 2024 18:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709607302; x=1710212102; 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=sAIg+K1FyMraMU/hEXtxnTmOqsREezzXahRBlOT5IeM=; b=dijRMFXLfkPYADG2VlA1OAv+UQEicz4xNAmU3FUwBSWzWGwap+WKaB5Ka6gryYFSDW 8lVSBuONpfDw42ukaxgfNtUNsS2qF1BXYPwLRRv6Lnp2k1ip44eQSEpJzLuLfghW8duQ aTWOmpkXNVdTOvihIWxWatxLa8m4bmZznQJneKMqu9zX9NX3BfePRngRg868Dxc3KdYl yHFUAj94nm3zjfabl6jKz1yGID7C/DaO8o4BlcbusnBC9dQPqcMGDl3GoeGMbDAlYJ/t 8nCfU7FPMY2v02WmjDEhGPlOqC5WVLxsO1UBFtpG0fuleIRY9y83pRSImnoYpagitLC4 nOZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709607302; x=1710212102; 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=sAIg+K1FyMraMU/hEXtxnTmOqsREezzXahRBlOT5IeM=; b=w4K0xhkNreMaaxaMAmGXtJDXVjGq5XVHZqxnm9FRwlVoxdfIAH3pmyirdGAkJI2rc5 vjp7P1oHwAe3U7LdypqMIq7DQd0rUHe/UCQqCn9KN/WPUMOjd8MnfvEDmjb0CMFocMzK uxbyijWl8F9txwiL6Gyyk45WCafdEDrFjTtuejTvdH/FPmWUsXMx3OMPPOLTGSoKX94x 4KlgzKlU4CEFcv75r3/X/jvIHNO8wMAjS8VVnJebyCwhYCb3mupx/RAUbG5G2e3ODK8Q LkQkfBmxD3Verv/YWQhmtzDC4meQ9F6dILI+sVzuOg/mdefvTJFuGqMIqJL0VZdi281c zIxg== X-Forwarded-Encrypted: i=1; AJvYcCVkoHACYITHA1gzDNQwi0mGCoTqVikVH2Imj91J3xiQYkgQZH1OwpLvQVkJ0rN+emXx65T/8vNqz0Jft69y/gumeNA= X-Gm-Message-State: AOJu0YygX3OOOslx52Sd+gl3FAMFes+Yxp+Hae848cpht3epONWsdOys fGqJQV2QmBRnTF7OY+VnlOtfmKyC3GZz7mbkH9onpBKjFVh5tHygsHdla1bWTWHqP3fzCspXNJt rCuzFCnHiJ490Hx4UfeBnCjolfvM3WMWKFUZT X-Google-Smtp-Source: AGHT+IHjypstYaY+noHFLDhZJNZzB9IufGE+xprQ7AYUqakRJaFNUa2rIE/XsEzEZvgz+iRo90pAzOdIMDUoOZ4dwxk= X-Received: by 2002:ac2:4186:0:b0:513:3483:e727 with SMTP id z6-20020ac24186000000b005133483e727mr326818lfh.48.1709607301552; Mon, 04 Mar 2024 18:55:01 -0800 (PST) MIME-Version: 1.0 References: <170925937840.24797.2167230750547152404@noble.neil.brown.name> In-Reply-To: From: Yosry Ahmed Date: Mon, 4 Mar 2024 18:54:23 -0800 Message-ID: Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Reclamation interactions with RCU To: Matthew Wilcox Cc: Kent Overstreet , NeilBrown , Amir Goldstein , paulmck@kernel.org, lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel , Jan Kara Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C9B03A0006 X-Rspam-User: X-Stat-Signature: c3y1n91bezpe6k9bu7yy5tojg3guaaip X-Rspamd-Server: rspam01 X-HE-Tag: 1709607303-123330 X-HE-Meta: U2FsdGVkX1+g51WG5TI1Y2C4ubMGYlXW1BPwBHqwGCqX/60+AK3fy14yU2gE/cC+wXNPWTTes69usNoq/ka+3fYVhqazM+2rUtz+D/uIMyKhwfftoBl54Ec0kPpmpD2IKYMPi5Lk5W3u3p5ceoD1SAx0EmXsEWsQQOqZ9cXdygj9axXNYORK9xgiEi5qGrT1uZMgErc8hTupdHE9mnoVtkhmjtdBmh5SvLwhwS8+h78DM352ngYZ6C0ZZe1XUSKN9bOcMXoIGk1s+mdcdJGtVtSqRk1+wfeDe9CkCmzPa5mNFP5FxRfgUt9Y+LYi6IltRMPxOWdvuwpbkWIiXQgat2lfZn/My7M4Q3wbxAcL6+P1QN5w8r+15sdI2N38YtWC9YlJRGYIsY0CPuFZM1iZEZvw57toaZO9DHGWBJUjt0haoGUEttVVRq2S06YyF0WY+nbK2cyo/rQtJv88g+PWL2E/YHpFp2qWiH9zdvQBc9ovg4D2I2PAOYMG6b1ERHQw1IF5Q7YO9/Mc8y8wlCeTOxyedgyFz6ILjtvRY+NPOOqXucj3Gxi1cfvpaOu3t6D16IQMM4I14Hhkn5LG+9TUAsyHlOoz2d7khBa41GqfVB09ukKd03YC74NPKwvEWgt5sCWacH0IUDQLmavHGQI9vGMeu7hsA6L830mCjMYlRqDDpJdPHr2CWn+x5w4JqasLbRlcAwCwIk+KrrmIPj/4IO1qvEGKZiUMqyq6aLHuOg7mfpinIAUWyAhAcP+iij5bSmyWHigVXb+5vVK8rN5y85N5ZbUcPqaaOP9aDHO4Bj1p5w9E41o99TKoF/K5ypaBpXMH2U/RFRwMjNBfwyh9DZVqqbWrJ0UGYgTyBA4iq2oRezKWOh8I3yF72BQ31/wO2hr3g8pRqTBvJyw8sMKXnS+ytPdosZmKlyhZEr+Lh1tSzcuFDVh8EReXWlRdgfB7ImfjdGwqc0+JmYTln9S qZA== 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 Thu, Feb 29, 2024 at 6:49=E2=80=AFPM Matthew Wilcox wrote: > > On Thu, Feb 29, 2024 at 09:39:17PM -0500, Kent Overstreet wrote: > > On Fri, Mar 01, 2024 at 01:16:18PM +1100, NeilBrown wrote: > > > Insisting that GFP_KERNEL allocations never returned NULL would allow= us > > > to remove a lot of untested error handling code.... > > > > If memcg ever gets enabled for all kernel side allocations we might > > start seeing failures of GFP_KERNEL allocations. > > Why would we want that behaviour? A memcg-limited allocation should > behave like any other allocation -- block until we've freed some other > memory in this cgroup, either by swap or killing or ... I am not closely following this thread (although it is very interesting), but I don't think the same rules fully apply for memcg-limited allocations. Specifically, because the scope of the OOM killer and available resources is limited to the subtree of the memcg that hit its limit. Consider a case where a memcg is full of page cache memory that is mlock()'s by a process in another memcg, or full of tmpfs memory and there is no swap (or swap limit is reached). You can get more creative with this too, start a process in memcg A, allocate some anon memory, move the process to memcg B. Now if you cannot swap, you cannot reclaim the memory from memcg A and killing everything in memcg A doesn't help.