Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7866063rwb; Wed, 23 Nov 2022 11:51:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7//ZIwP7nB6SViKewt2bYMUTpkTHLuxNNeFyfszermAhYdpoXR/DWTrS6JjoRdgAnIL4do X-Received: by 2002:a17:90a:e657:b0:218:f115:792c with SMTP id ep23-20020a17090ae65700b00218f115792cmr2806683pjb.121.1669233074865; Wed, 23 Nov 2022 11:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669233074; cv=none; d=google.com; s=arc-20160816; b=vl/1gza6tMhO0bb/oUlnkbsap2RwOceY20GZpN7iUokhcdPTAPWzehBOQGfx0no6vu syIQbZvJnNwI/lsoBA5iSkSKpurBEjLlwUWOFLnyZ6D8fMLuHzAisNhhacyU8RBR3IBK LWeCp61dmun8hHR1Up4Xr2oXLC2dPIQZI3ORGCem6Jc2MsY6qtYCZzW70ldvLW+rrzeR 9i/oio7rHQuEuVsFL8DqsepvIkaHNAdEPIVIPRrBYY5MZN8iTCZocKznmMRJNQw8vSeb hd2cQIsn+orj1NQ/EdwmfN55WcMXyRbW25vj9/3G+oLmuk4RGjMOQvL2rdaKN0BXUrg5 47IA== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SDRg/5ZBX3XDzjEuh83I6NIeECdfJo03H+sBbmb+sh8=; b=m3vMWh/oanR+WssqRNQ6u/mC8awTCWJez04oiqavuJ43kee6jVa94i4tPV4nx4ieEd 46q+lwxBcebnLTCjuf962K3AScoEenFEMFjUbprqvAr+h5H51Q02ckbnFv6UPa0QMJHL nM2Miubd0hW3eV3sXs8loZjCprN5ULOHbVxHWalXY2qaCRcB0H+wh8AcwFtiQd/++qTg ZWMPUxgKthXtWnjCeZLRbSnSxX/ff+pzL7EE1rrEa/scNDptPsxNxkxdAb4BgDDMdJdT 444eY1Ufq7zLCXYI+CNYwZeLG2BN3knZzr+J0hfH7VniePXdg0mH50NGVo39D1xoBL8v L+zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dkryz5Sg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a634c43000000b004637c92ef98si15841280pgl.195.2022.11.23.11.50.58; Wed, 23 Nov 2022 11:51:14 -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=@redhat.com header.s=mimecast20190719 header.b=dkryz5Sg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239654AbiKWTHL (ORCPT + 88 others); Wed, 23 Nov 2022 14:07:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238111AbiKWTHJ (ORCPT ); Wed, 23 Nov 2022 14:07:09 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C71A5BA6A5 for ; Wed, 23 Nov 2022 11:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669230368; h=from:from: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; bh=SDRg/5ZBX3XDzjEuh83I6NIeECdfJo03H+sBbmb+sh8=; b=dkryz5SgAswR8+p0ysIVi/dtlTnIDHtP1rgMBl3H+p5vQF6Zvhp08QmTa11skvtJkaqb7v 13sECKH0lz3PuMF15lirWHCCC9ExnvojPP/fD7on0QoAazRpR4Le+LyGnMsGtPU1iODK9e kbeUmiIR7hDd0v2Vp33Ck3qmlCwEh0o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-166-6s7-BiPVP5G29OaqdhZcgg-1; Wed, 23 Nov 2022 14:06:02 -0500 X-MC-Unique: 6s7-BiPVP5G29OaqdhZcgg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 392181C068CC; Wed, 23 Nov 2022 19:06:02 +0000 (UTC) Received: from [10.22.17.47] (unknown [10.22.17.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id A86FDC15BA5; Wed, 23 Nov 2022 19:06:01 +0000 (UTC) Message-ID: Date: Wed, 23 Nov 2022 14:05:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] cgroup/cpuset: Optimize update_tasks_nodemask() Content-Language: en-US To: Tejun Heo Cc: "haifeng.xu" , lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221123082157.71326-1-haifeng.xu@shopee.com> <5fccf438-fdbe-1bc8-6460-b3911cc51566@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 On 11/23/22 13:54, Tejun Heo wrote: > On Wed, Nov 23, 2022 at 01:48:46PM -0500, Waiman Long wrote: >> I think it is an issue anyway if different threads of a process are in >> different cpusets with different node mask. It is not a configuration that >> should be used at all. > Anything memory related is in the same boat and people still use them > reaching whatever end results they reach. Given the whole thing is pretty > ill-defined, I don't wanna change the behavior now. I am just saying that this is not a good config. I don't have any intention to change the existing behavior at all. > >> This patch makes update_tasks_nodemask() somewhat similar to cpuset_attach() >> where all tasks are iterated to update the node mask but only the task >> leaders are required to update the mm. For a non-group leader task, maybe we >> can check if the group leader is in the same cpuset. If so, we can skip the >> mm update. Do we need similar change in cpuset_attach()? > The leader isn't special tho. We just wanna avoid visiting the same mm more > than once, right? Right, the group leader is just a marker to make it easier to avoid duplicating the work for the same mm. If the group leader happens to be in another cpuset, it will suffer some performance consequence. Cheers, Longman