Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5551794rwb; Tue, 22 Nov 2022 01:22:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf52YUW8Jw3+sLxz96uRASdoRp4Ieadd+vOFL4Y1eKtIEqWvJWieIfRWvemfU5u6acOuPIig X-Received: by 2002:a17:906:2d49:b0:7ae:16a9:e4d7 with SMTP id e9-20020a1709062d4900b007ae16a9e4d7mr18704785eji.574.1669108960710; Tue, 22 Nov 2022 01:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669108960; cv=none; d=google.com; s=arc-20160816; b=dCjUB1tKyaPX27nekx3+adO/vuhXgyTChSKB+sZ/aGQRpzBCIGasTPWe65vn16KeXF Or6fTwsosb+fSztRgrZP4+riUq5fCBQnmF/754eo4YMoMksgYTbQoafoElDD+Stm9Mts 1dLYLGYBcr+bszK4bHqkgusxfrGFREWC9TB7iAoCqV1rdvQyrr2+bFA5dhY55WVOyOur v9TQlka50F0aSsW6Rgn+wqgZ2xd65nR/Vd2UhP8gmKTHBd2FJwMrNU3eG0myhuz8/MfP 7Amtn2ZpnYehVM2RQY1HxexzdE4AEUszDmHYphiNcfyqb5bzyqRP8y3+WxaiJwUUi24G JTeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=ICq6wKj+fTCmm2GjCUS1L0jcKrWJpIWh5rHEbpke/Aw=; b=K/gqzHf3qTv3dncFwSngCuK3908rpcF99ctyiAqEQZm4IE5MzCJ65KPFAmV5sB2OeQ 0K+bOXGybUIi04RHUmiwlDbcp6TydXyKnL7v+cbRTlWmGVAGYsw559kztPKPUQlo+NlD B96slWyHpQYk6lW5WgwDprEqIkSEemLDIsG1Yz6uHWDw3b+IflRLUKezmHCvZhvZw8MR idoLnWsLY17Iv+Z2tZksXZOeXZe8MAwTAz8KKmgDQqP960eHVWaMh+HmIsSm0tjBZXNW ow2mYdwrqHzhCB2SuhNuSutDEISRPFvhes1GOROtkDbTijUOIlxcSI3Jn3aSEHhkNN4c 9VUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F97DvddP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056402090e00b0045cb68ca4ecsi13005132edz.37.2022.11.22.01.22.18; Tue, 22 Nov 2022 01:22:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F97DvddP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232840AbiKVIdU (ORCPT + 91 others); Tue, 22 Nov 2022 03:33:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbiKVIdP (ORCPT ); Tue, 22 Nov 2022 03:33:15 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FEC2AC52 for ; Tue, 22 Nov 2022 00:33:14 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id y10so11770075plp.3 for ; Tue, 22 Nov 2022 00:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ICq6wKj+fTCmm2GjCUS1L0jcKrWJpIWh5rHEbpke/Aw=; b=F97DvddPsXnZFYx+QA0dfxA6f30QqDBS69xRYssBkziviud34e1LSnX9q7xF/57AuE dP0StyJf+OaVouXPLVZ/Ce+C/uKXJ3gYoZLnAf3E2UnKyLAaykL9jHZe/J0qxWLvcb/3 g33c/xMTGng9r4Aucbbcy2yDCaxrt1nzY+QrQn+7LJY5gScK/lNJ81AxkYA6Mkxa0BX6 QNcoi8zGYqUflEtd5A7aOuBkTkGgviLK1RaQ5ICYAt2/4eupEedkUzUNheoKnfMJYl/X LaEncu+bZgFb7Dv0ZAnsZdMJJ7eXn3+HMe/TtL6Im+9ZI7GtgiKzgFhM8R9Oej5E7otX 0UOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ICq6wKj+fTCmm2GjCUS1L0jcKrWJpIWh5rHEbpke/Aw=; b=2HuPb6rrVUDVFdvtJ9gGacJYEPFB9SDazrJRG8AV64eMdZ6GXmAbX/DX5RaByLAi4M rvs4k2KPLkSE6VaX0IJwXrBiQzRsBq7O1N3ePLgoV/6n70Br5vrBjSX00u9DBFthj0qn IUZrFWyXf4RWmuay7ftW8tBTcVLLfWwd9YY7adJEnLX2im5658wYBkWJnVg158hF7yCh cR9aQgkRYUbBvjtR+3AZ2FCmtwN0rQPul/rP+aJCfRWIl4oD+1mBZRsBFtVcnHECkJXf 7MlaTlblByHJbeSdaDjXfMY2yxYGZIEsCktP5IpsG0Ni8/tqLBHEGM7nGi62wwdPIY0F aHXg== X-Gm-Message-State: ANoB5pnQPXr+3BN1pOSqzswT59hRHyxU2enyXn6nG9yTzCYy9LrUsI3m qsJ5I/kWNhii9APXn7aLYmaK0g== X-Received: by 2002:a17:90a:d38a:b0:218:a7e6:60df with SMTP id q10-20020a17090ad38a00b00218a7e660dfmr11210368pju.38.1669105993608; Tue, 22 Nov 2022 00:33:13 -0800 (PST) Received: from [10.254.109.138] ([139.177.225.251]) by smtp.gmail.com with ESMTPSA id l12-20020a170903120c00b0016c5306917fsm11448352plh.53.2022.11.22.00.33.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Nov 2022 00:33:13 -0800 (PST) Message-ID: Date: Tue, 22 Nov 2022 16:33:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [External] Re: [PATCH v2] mm: add new syscall pidfd_set_mempolicy(). To: Michal Hocko 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 References: <20221111084051.2121029-1-hezhongkun.hzk@bytedance.com> <20221111112732.30e1696bcd0d5b711c188a9a@linux-foundation.org> <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> From: Zhongkun He In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. __ Best Regards, Zhongkun