Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1055000rdd; Wed, 10 Jan 2024 07:24:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRPolupheF1LOZ2TnWCb4i0LCe6/+ZedE7SnCR6yd1egSUDT1tBRE4aCy/+XeAHu7mkRlw X-Received: by 2002:a05:6a00:1c82:b0:6da:1d9b:a17a with SMTP id y2-20020a056a001c8200b006da1d9ba17amr1371899pfw.25.1704900278540; Wed, 10 Jan 2024 07:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704900278; cv=none; d=google.com; s=arc-20160816; b=Q9fplTaYy6KxGkAu0aBT4fZ8YWCOjJH05ekWW9R/WPlACK8QDcnE/ExGdBqV8/pAno ZqV65W1vPYOLcK7t8Z83uUg9kN4jeuUdwGfPgXHOCLekJUcoRMvKVpVXvA85iJAH3mH9 yMA9mXmBYXxZk7YAG+xYGcM7w1OQFr9MIbJKxxXL0WSvxkcsTuJmO4H13/53sV2TV6Iy 7OmOr2jbA/AYcelIyO9jvbmNdNYtChGhUY5Fx/GmPh24QYs4lYzdk7XY0jojVbwV9G4u ud8+rWYbSFYIbF9pZntk+gO51R8wey7GEGP1puZJbZ+zsAPgciN7hEnOHpIMhqEgmrjT f9ew== 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=VAxvn7n382nb2JvBceqLwG06b5S0HtkbsTWBf6oLhXo=; fh=h2yDiJzBulgH3P6QCmwkvPj3UDsmaKn0KyWD1T/JNPw=; b=upXQw+Xxzmmo9YjwG4dSjw0HCB6CRnIiG4xBLz59/zFTnTFthpQpp22g+wZDVPX320 oF13CwVyMurb6E/BSs+mue9MEtTbDewMOizVLn973YzcUAtz5JokDhnaa4UNKvM7Xu2a 34P1Zmn0KFoBjY2PICSiO7pgDgwhL4CArj6kPVm4BuCKR3/2OWNvabZBbRBqLbmVRmIN 4WNmUd73XbkU4yvvFNdu6RnOB0shHWeehl4g5OjO8njyEw8pXMZgBuoRWy/K+6lAJlO5 II3uu9eywgV1zmM9d7QyH2waW1KgTLMMVi8rzJYRfHRcGR+hGQyfZ2GLDwnUhLllGT6F +F6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ViVNdb1f; spf=pass (google.com: domain of linux-kernel+bounces-22422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22422-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x23-20020a62fb17000000b006d98c793ebdsi3741502pfm.318.2024.01.10.07.24.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 07:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ViVNdb1f; spf=pass (google.com: domain of linux-kernel+bounces-22422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22422-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 195C6B267C4 for ; Wed, 10 Jan 2024 15:22:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5D044C3B1; Wed, 10 Jan 2024 15:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ViVNdb1f" 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 93B484BAB6 for ; Wed, 10 Jan 2024 15:21:54 +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=1704900113; 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=VAxvn7n382nb2JvBceqLwG06b5S0HtkbsTWBf6oLhXo=; b=ViVNdb1fthSwWw1l27ZhHsTBBvqx78dCZ3MBux/KTOn7/+jDO7KIF3uLDJoe8pyTB0E8gP sz0kqp/JhpU3BbUQBQLX8ftD9/cWUbcj/fZBZm4wdRHdrvd4N0ADjKvIPjya3LolmJkvUT qlo3VoS/2oi2HL8V9B3sKLiZPfyZckk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-207-ZwH3KG3NOI2BD9ypO7kKaQ-1; Wed, 10 Jan 2024 10:21:46 -0500 X-MC-Unique: ZwH3KG3NOI2BD9ypO7kKaQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 66838881F0A; Wed, 10 Jan 2024 15:21:46 +0000 (UTC) Received: from [10.22.9.232] (unknown [10.22.9.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EBA5492BE6; Wed, 10 Jan 2024 15:21:45 +0000 (UTC) Message-ID: <163ab1ad-e768-46f0-a6bc-dec1759c3d71@redhat.com> Date: Wed, 10 Jan 2024 10:21:45 -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.10 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; This statement cannot be removed as it is used in the following statement to size the allocation. This change the behavior to make doms NULL rather than a 1-entry array. This is probably the cause of the kernel test robot failure report. NAK > 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 > >