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 167DDC433FE for ; Tue, 22 Nov 2022 08:40:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0FE96B0071; Tue, 22 Nov 2022 03:40:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BF956B0073; Tue, 22 Nov 2022 03:40:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8877C6B0074; Tue, 22 Nov 2022 03:40:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 74CEF6B0071 for ; Tue, 22 Nov 2022 03:40:18 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4452780DE0 for ; Tue, 22 Nov 2022 08:40:18 +0000 (UTC) X-FDA: 80160431316.08.1DDDB61 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf22.hostedemail.com (Postfix) with ESMTP id B5C34C0009 for ; Tue, 22 Nov 2022 08:40:17 +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-out1.suse.de (Postfix) with ESMTPS id 0A49E21F4C; Tue, 22 Nov 2022 08:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1669106416; 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=8BZ09nC+Ltb5ETuM0UVHvj1htjE600StTsDaDLvmw28=; b=Ejw1DBowwlD1MjGWZTvlL9cwgiYFjIT1GODBe3YPf+UfBsmX6zfGtD9/YNB6PKhsQANtUP Sl6oIxkVZMl8Osn6QTVBiIpJx0pVxG3AWBwnehh4sI23sYah90hsobVfqYd5sdDHDp08rS mmGmTVnERp0vqFnoAEDw+SQZ84WYvCo= 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 E0A8513B01; Tue, 22 Nov 2022 08:40:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZRqONO+KfGP9IAAAMHmgww (envelope-from ); Tue, 22 Nov 2022 08:40:15 +0000 Date: Tue, 22 Nov 2022 09:40:15 +0100 From: Michal Hocko To: Zhongkun He Cc: Andrew Morton , corbet@lwn.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [External] Re: [PATCH v2] mm: add new syscall pidfd_set_mempolicy(). Message-ID: References: <3a3b4f5b-14d1-27d8-7727-cf23da90988f@bytedance.com> <82c9c89c-aee2-08a3-e562-359631bb0137@bytedance.com> <0bd0b744-3d97-b4c3-a4fb-6040f8f8024a@bytedance.com> <6433156f-34a8-400f-e282-91268b242279@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669106418; a=rsa-sha256; cv=none; b=sf/b01PXurY+deq2quPLJfDDcAut1K1gewbMEECbPHSpSyek4wVbOZFsbYnDK1GpWBfBQk t9273q+OqVS7BPTv4fRQJuonJf9vEERu6Fjb4yHt8LHt8caoJXJmOT8JfG0gDXtW6vsp7R d/GYZgj0a1YaGaniC//fjcOFtNsyhIc= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Ejw1DBow; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf22.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669106418; 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=8BZ09nC+Ltb5ETuM0UVHvj1htjE600StTsDaDLvmw28=; b=rX63W31mMfday1cmTCIBGOqWcXC1F34ffj94wB9rGizs+UPvZXG76iV2BJPPsZ5l0GmLwT Jhcr3ftB1DIDO5i1VVq3ENRSShZKD2hRxEYNXkwTaOTcDwC+T2jGJeJ0XqBEahcjKtpQdM 1RPtXsNDi1HR27PGglkVStcs+ghpnUQ= X-Stat-Signature: 6icy7r331ogafcsp6h8e8e5pdtsxofgo X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B5C34C0009 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Ejw1DBow; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf22.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-HE-Tag: 1669106417-543286 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 22-11-22 16:33:09, Zhongkun He wrote: > Hi Michal, thanks for your replay and suggestions. > > > > > Yes the memory consumption is going to increase but the question is > > whether this is something that is a real problem. Is it really common to > > have many vmas with a dedicated policy? > > Yes, it does not a realy problem. > > > > > What I am arguing here is that there are essentially 2 ways forward. > > Either we continue to build up on top of the existing and arguably very > > fragile code and make it even more subtle or follow a general pattern of > > a proper reference counting (with usual tricks to reduce cache line > > bouncing and similar issues). I do not really see why memory policies > > should be any different and require very special treatment. > > > > I got it. It is rather subtle and easy to get wrong if we push forward > with the existing way and it is a good opportunity to get from the > existing subtle model. I will try that on next version. Thanks for being receptive to the review feedback! -- Michal Hocko SUSE Labs