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 200B2C54EE9 for ; Tue, 27 Sep 2022 10:49:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DF636B0078; Tue, 27 Sep 2022 06:49:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98F878E00C2; Tue, 27 Sep 2022 06:49:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 857718E00C1; Tue, 27 Sep 2022 06:49:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 760276B0078 for ; Tue, 27 Sep 2022 06:49:55 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 44549160F1A for ; Tue, 27 Sep 2022 10:49:55 +0000 (UTC) X-FDA: 79957545150.11.1BAE8C0 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf08.hostedemail.com (Postfix) with ESMTP id C3C76160011 for ; Tue, 27 Sep 2022 10:49:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 99A5C1FAF1; Tue, 27 Sep 2022 10:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1664275792; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G8dqFAhkv4BryP1THvyAkwJNHBTPJawb0NYObWUxY9w=; b=VPdMo9+yxkx3+UAodpV1393pNS+NneaMam/tNJK5JusGnkPfyzFoiR29ybyBFq4k2kWl9B sWp670PEDwr3dT3IhBkC9XHtJGwul7Z6fB7z27ixWLiNcJmZ8CAJd3mpjQPqE1tucjmLNk XXqvbxuOJk1+lOZKMFTErFxRxO55aTk= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 789EA139B3; Tue, 27 Sep 2022 10:49:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Gvl1G1DVMmNxWAAAMHmgww (envelope-from ); Tue, 27 Sep 2022 10:49:52 +0000 Date: Tue, 27 Sep 2022 12:49:51 +0200 From: Michal Hocko To: Abel Wu Cc: Zhongkun He , corbet@lwn.net, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [RFC] proc: Add a new isolated /proc/pid/mempolicy type. Message-ID: References: <20220926091033.340-1-hezhongkun.hzk@bytedance.com> <24b20953-eca9-eef7-8e60-301080a17d2d@bytedance.com> <7ac9abce-4458-982b-6c04-f9569a78c0da@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ac9abce-4458-982b-6c04-f9569a78c0da@bytedance.com> ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=VPdMo9+y; spf=pass (imf08.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664275794; a=rsa-sha256; cv=none; b=MIIOSobKcvf6dzqRTi7nIdXEZHoLx1xRtDorH78t62qMHYUZ3qSWZj7R8XL3JPRI6+igUn AnaygoXdAPbfxAys07OcGyvN2HvOuOQuKvMi1Jf2avaYY3DdTUOty2jAVDbQV3GvyJvFCH TiRhVOdQ7lzX4M/I/otWqcLXLqEV5Yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664275793; 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=G8dqFAhkv4BryP1THvyAkwJNHBTPJawb0NYObWUxY9w=; b=AradgHw1/166Gqx1ulvhhP8YYnMNVo4FHJMY1Vx8bVMoO7ZkOxbBN8MH9kYwTBxqnxpckM Cz1ULbYmmaWSGDwZIRhnqXym03Ct5JxcLtsKxDtykkBwNijUuOBm9GZiyX7J5i6Ze7rAys DvpBxldich4z2xWp9H1DcB/dx+FQQ6s= X-Stat-Signature: y8rhp88cszxs3zt6xwoe3dfsjta399x9 X-Rspamd-Queue-Id: C3C76160011 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=VPdMo9+y; spf=pass (imf08.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1664275793-238420 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: On Tue 27-09-22 11:20:54, Abel Wu wrote: [...] > > > Btw.in order to add per-thread-group mempolicy, is it possible to add > > > mempolicy in mm_struct? > > > > I dunno. This would make the mempolicy interface even more confusing. > > Per mm behavior makes a lot of sense but we already do have per-thread > > semantic so I would stick to it rather than introducing a new semantic. > > > > Why is this really important? > > We want soft control on memory footprint of background jobs by applying > NUMA preferences when necessary, so the impact on different NUMA nodes > can be managed to some extent. These NUMA preferences are given by the > control panel, and it might not be suitable to overwrite the tasks with > specific memory policies already (or vice versa). Maybe the answer is somehow implicit but I do not really see any argument for the per thread-group semantic here. In other words why a new interface has to cover more than the local [sg]et_mempolicy? I can see convenience as one potential argument. Also if there is a requirement to change the policy in atomic way then this would require a single syscall. -- Michal Hocko SUSE Labs