Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2815785lqo; Tue, 14 May 2024 09:55:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJ/x07kZmDgq/JUo1ZY2okQtlOgnWUJ9PFs9etIePm0ck50Hh0W/0WiT6GGqYoU/TDLyEceIVRn8aM5lhiM0JSsly5m9MaQocmGnHmog== X-Google-Smtp-Source: AGHT+IEPLXIFGESvDm7C6EG2hYlL30Adrqrr6On+E3yJjdQtffqQ2vRZsJPLmDwCJYByQX8ikWdj X-Received: by 2002:a17:90b:124b:b0:2b2:aac3:fc2f with SMTP id 98e67ed59e1d1-2b6cc76d796mr13373898a91.18.1715705759037; Tue, 14 May 2024 09:55:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715705759; cv=pass; d=google.com; s=arc-20160816; b=YKVxuwBxINSzHjadbKpVIsPBXq0n7YlmWQCTKo8avkuswRH+Yc22/TpIUJ4DBlWQUj 6ygnDVPkrxEg5oGgsUvGYqhWNrXJxlwAoZsp4zjlWvdzCjwLJes+O3f9OGTybY81F8Fg 1f6+ENrZia2wwd0oET80tOcx8iUDVgYshLwFhNNLjCQggGMVUrlswfJca/DS8UWFC34Z +6WfJjNoBzGLo35qixYU6lBdgHGZ+b2ii+dtX9y4wYSP04sNGv8Bzy9pG6QBbXSdT3UF 5qM/inxvTmuKs5qIawved4hqI60N4q6YdW7swVi/wC9dE7IkIYsNLgZZuzsiAib/xCsr FL8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1Xc3VFjZ08Mc4cSLOBVdBw5V+Qgn6KoMPCEk8F7ooxQ=; fh=vlrC2APFNPbJvuC82SEu5TaZooyOsqO9xrDAIOijtm8=; b=OMxvJPgCk4Cmz702sVz4z4p2yplpWixDCDtPfymQ4pxoCEzueFab+TDmGPsiq1pHPg PIR6T/D4+RIkSu2spwxiefjo5mLBE9OaL9cNvcTTTJe+lQPEChYBO0aLg3oKY20w8Xtu NVvxCI/9AXoHeb6rWwL+Csoyw3TPqY9Prc6yyz1E6gwbTtbdfXwD9qzrzB+KUl7dK/SL RlfRbQ6DQHStot+nyDtcaGplLzGOjanEZNrR7a75BWaxAZB1W9B4SOec3sxlFrljKFzA cfGGq86IAmYX3sb08Eu2oxZoZyi3aPd8Osv46a7NsLJxMshIF5CLPpXq2vxXlp60lZnQ rdTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2WoAXSM; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-178973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670e35509si11932278a91.31.2024.05.14.09.55.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 09:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2WoAXSM; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-178973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 93FD0B21585 for ; Tue, 14 May 2024 16:55:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFCBD17F389; Tue, 14 May 2024 16:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W2WoAXSM" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA00912E7F for ; Tue, 14 May 2024 16:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715705750; cv=none; b=cRqIcPU/CeRrcfbqEhps45bvJFvMguECXzypODVuWULOLtTt3UV4kjlii02qxfCwK1xP3/VrYlhrRODbUM4HMrEJ9DA5W+LiWl8/nUDoduUWX2xfK47MqGmxnHfg2r0U/AGIqPtWpgXFdLc/B4LZFNo36hjY0cy0X5SZ/EwpED8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715705750; c=relaxed/simple; bh=lELqUKrJlCCY1VkA2cO2YbrvZapdf1v79jnvhnwCVVc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JNGKIkORu3oOgdr0z/tEN9G8P4nltL6zKEOvqHTeO64Uxku9lu+h9BDaHIMvphOM15rekOdXNJeNErDyFPOGXdxU02gfTN6Z7i3Bt+56tThGP8FcOwAB8hZ3aTKo7+yB43ZMlP/GxCCmG9WELnY+6j0nxdgtylO9sUOVHLXdnpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=W2WoAXSM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715705747; 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=1Xc3VFjZ08Mc4cSLOBVdBw5V+Qgn6KoMPCEk8F7ooxQ=; b=W2WoAXSM/Bzfcn4eyGXrbZXQRgX1MMg24iPSrA59HaKGslN9BYBVJhVlU8hej/T8dS56jo HVmW3O4y1e4sqkyHjzXWzLhJGlSxeBT+rkh711VBRrC+eNXbyjzEXrxCmc1fY502Uk6lh0 z3QPyzYSxzIOY1tNs+T9cwy/f5uog9Y= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-4rSj7Fj6OKer9on9Dp2reg-1; Tue, 14 May 2024 12:55:44 -0400 X-MC-Unique: 4rSj7Fj6OKer9on9Dp2reg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 724433800BA7; Tue, 14 May 2024 16:55:43 +0000 (UTC) Received: from [10.22.34.104] (unknown [10.22.34.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79150C15BB9; Tue, 14 May 2024 16:55:41 +0000 (UTC) Message-ID: Date: Tue, 14 May 2024 12:55:41 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/6] cgroup/cpuset: optimize cpuset_mems_allowed_intersects() To: Tejun Heo Cc: Yury Norov , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Paul E. McKenney" , "Rafael J. Wysocki" , Anna-Maria Behnsen , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Frederic Weisbecker , Imran Khan , Ingo Molnar , Johannes Weiner , Juri Lelli , Leonardo Bras , Mel Gorman , Peter Zijlstra , Rik van Riel , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Zefan Li , cgroups@vger.kernel.org References: <20240513220146.1461457-1-yury.norov@gmail.com> <20240513220146.1461457-6-yury.norov@gmail.com> <911ca229-4849-4fd2-8ae8-5ca653d8a5e3@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 5/14/24 12:50, Tejun Heo wrote: > On Tue, May 14, 2024 at 12:47:59PM -0400, Waiman Long wrote: >>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c >>> index 4237c8748715..47ed206d4890 100644 >>> --- a/kernel/cgroup/cpuset.c >>> +++ b/kernel/cgroup/cpuset.c >>> @@ -5010,6 +5010,9 @@ EXPORT_SYMBOL_GPL(cpuset_mem_spread_node); >>> int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, >>> const struct task_struct *tsk2) >>> { >>> + if (tsk1 == tsk2) >>> + return 1; >>> + >>> return nodes_intersects(tsk1->mems_allowed, tsk2->mems_allowed); >>> } >> Reviewed-by: Waiman Long > I'm not sure this is worth the added code. Yes, I do have a second thought afterward. The only caller of cpuset_mems_allowed_intersects() is oom_cpuset_eligible() in mm/oom_kill.c. So I believe a better fix is to avoid calling cpuset_mems_allowed_intersects() there if current == tsk. Cheers, Longman