Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5653992rdb; Sun, 31 Dec 2023 10:29:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1s66FsNl10gfr6ld258hLA+6JMGzcxoQdJV1wQoo24eRQy3YIQslySMFgeFG7CefbxVQN X-Received: by 2002:a05:6402:8d7:b0:554:c89c:d295 with SMTP id d23-20020a05640208d700b00554c89cd295mr6393362edz.73.1704047366263; Sun, 31 Dec 2023 10:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704047366; cv=none; d=google.com; s=arc-20160816; b=PpnX1rqNi9eTA2yScdkSoFFryHFUBtH7Z9GPIKnLxa71QDiE5lsqi8qrgQT6luRzad kleQqXIjYTrw3kpRrNVMBzkycq65Aub3ffSJTsU8SZvcat3hkC61S9C+U/vB7ypfWD0D yktS8hGn5u85YNgz2MxRSEHdeYC/rS/4xDYTNHW4fHcEKvvebvVdkJmTe+hf5MQKwFro uk9wO5jYCOrP/4ZPTglsKHb2LhkvmuMstGn/VNIN+T80GYqEx3WP8q/ny6mPix5ySf4A GWBqqyssg9kcqiIHXnUVfAH+37X9qAdPvLTTFTr0XebG04cD30e5MJj+lqRZd9OClgBj KQXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=xbKtsWantMEXThLYzEBmJn42B3DxhHaKLrOeSwrFILQ=; fh=h2yDiJzBulgH3P6QCmwkvPj3UDsmaKn0KyWD1T/JNPw=; b=Ht1+8vZ2BnJUYIHZDQrSREA+7Y+KjwYSMkAWWWyLCa6p8ZORoonfIkC1MZWj81vrZb 6+55gxdh52Z0fB0o/ng/OiVa+db9nJEHX7jXsq4zavb+Jeqvw6FhEGSrP8f80Pi0dnZn XQ3BijkLOwrIRp7K8iZahpWXtyYI58443lnHfQgUt4Nafkz5F8oA6MsndJtEt4qT0a63 +SnRru/Lr2xjw3mXSlvKHquLcRXAjYQZjs46wBohPpKGlCHfR+zfNGcA4ovtZpRx6AK+ 8oFkEHDJTjAl8WIbiI3cUp3SmcpU0OhcqwmYe+aJ/kjDMUgu/FWnVL7dmnvqaUFe+P+U ABvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G1q3PQC8; spf=pass (google.com: domain of linux-kernel+bounces-13779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 8-20020a508748000000b0055469363fe3si2618293edv.192.2023.12.31.10.29.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 10:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G1q3PQC8; spf=pass (google.com: domain of linux-kernel+bounces-13779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13779-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0C26D1F21CCE for ; Sun, 31 Dec 2023 18:29:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CABDB947A; Sun, 31 Dec 2023 18:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G1q3PQC8" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 6EB939447 for ; Sun, 31 Dec 2023 18:29:16 +0000 (UTC) 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=1704047355; 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=xbKtsWantMEXThLYzEBmJn42B3DxhHaKLrOeSwrFILQ=; b=G1q3PQC8j2oesPBhHyB7NwHSCofYod1v5wZF/IutzfFm/CsCF2zyTpYzbxgvC0tV/s7rpf tYLJ37frDJvj3ZqtWCimoQ56JPmaPDyVB/whY7cYpp4hfb51aBslz/O9PZ3octYcRZgWpX GpD+5SkYeuncTsZKqNjZRbAOwBr1I2M= 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-150-fUJRyvvKP9-2TzsWqTYx8g-1; Sun, 31 Dec 2023 13:29:11 -0500 X-MC-Unique: fUJRyvvKP9-2TzsWqTYx8g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 8E4A63806636; Sun, 31 Dec 2023 18:29:10 +0000 (UTC) Received: from [10.22.16.25] (unknown [10.22.16.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B1CC40C6EBA; Sun, 31 Dec 2023 18:29:09 +0000 (UTC) Message-ID: <9cd1ce1d-15c7-427c-9929-f3c75b97b49c@redhat.com> Date: Sun, 31 Dec 2023 13:29:09 -0500 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] cgroup/cpuset: Adjust exception handling in generate_sched_domains() Content-Language: en-US To: Markus Elfring , cgroups@vger.kernel.org, kernel-janitors@vger.kernel.org, Johannes Weiner , Tejun Heo , Zefan Li Cc: LKML References: <53be5f98-6359-48b5-955e-fd203d99d3cb@web.de> From: Waiman Long In-Reply-To: <53be5f98-6359-48b5-955e-fd203d99d3cb@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 On 12/31/23 02:28, Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 31 Dec 2023 08:00:31 +0100 > > Two resource allocation failures triggered further actions > over the label “done” so far. > > * Jump to the statement “ndoms = 1;” in three cases directly > by using the label “set_ndoms” instead. > > * Delete an assignment for the variable “ndoms” in one if branch. > > Signed-off-by: Markus Elfring > --- > kernel/cgroup/cpuset.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index ba36c073304a..29ccd52eb45c 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -973,10 +973,9 @@ static int generate_sched_domains(cpumask_var_t **domains, > > /* Special case for the 99% of systems with one, full, sched domain */ > if (root_load_balance && !top_cpuset.nr_subparts) { > - ndoms = 1; > doms = alloc_sched_domains(ndoms); > if (!doms) > - goto done; > + goto set_ndoms; > > dattr = kmalloc(sizeof(struct sched_domain_attr), GFP_KERNEL); > if (dattr) { > @@ -986,12 +985,12 @@ static int generate_sched_domains(cpumask_var_t **domains, > cpumask_and(doms[0], top_cpuset.effective_cpus, > housekeeping_cpumask(HK_TYPE_DOMAIN)); > > - goto done; > + goto set_ndoms; > } > > csa = kmalloc_array(nr_cpusets(), sizeof(cp), GFP_KERNEL); > if (!csa) > - goto done; > + goto set_ndoms; > csn = 0; > > rcu_read_lock(); > @@ -1123,6 +1122,7 @@ static int generate_sched_domains(cpumask_var_t **domains, > * See comments in partition_sched_domains(). > */ > if (doms == NULL) > +set_ndoms: > ndoms = 1; > > *domains = doms; > -- > 2.43.0 > Please clarify what this patch is for. Is it just a cleanup with no functional changes or is there a bug that is being fixed? Cheers, Longman