Message ID | 53be5f98-6359-48b5-955e-fd203d99d3cb@web.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3402845dyb; Sat, 30 Dec 2023 23:29:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXWdER9mq84sUdITre+ZZm4pKsx+lvRKPe8RA1jg0N+eCJBBykFtGW/LL5NjClJCf8qjm0 X-Received: by 2002:a05:622a:1441:b0:425:4054:bc47 with SMTP id v1-20020a05622a144100b004254054bc47mr18037124qtx.35.1704007742473; Sat, 30 Dec 2023 23:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704007742; cv=none; d=google.com; s=arc-20160816; b=r6K21q0uvnlqu91u+N5Ms9frgPAkMbltEaDYHo6jgms7XXRBB4xUwsXGITqQswAyHO P9QUIjw7CnJ7ifeGnzZalRv3g0tO50Od+XJr0Xk6J7X2Wo+M1XLZjRsR8hy/Lv6ppj+f v9u9ZebUmL0VPd/eyHO7rEKxWObjOPJGC4R+Epc6ZW2LnDm+J2oBwEcW+oB8cB+cL/PR enIao1Ytiim6wESyj8h30vmpT8F5f4Bodssy9waMJdg4kiGctIdQy3OdCFPPYo0LDY/6 w4oRM3yFtar7CE6t2b3EJlRpecAh7SkDwnUtd+trWzroiVoi+L1y3qNP3K/V09qHxqDl T6Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:subject:from:cc :content-language:to:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=banR3g8EbH9yourjxopLyAzCV0T6Fqvhb3Wbf3LDQv0=; fh=yWb7c5p4VgAwEBbILEKljyC9DtnJlngE7TiHqYRtp/k=; b=UCoTzFwXgWce5Z3qDJtIlkQr9fpO5tnmZ989YzT0TMgSKO/iEDETBOVL/LMoOtRynv /JF/6LEKa4CFeoMQfl7bEYQnydttGkCguuOv33p+5yKxLqt0G6LRMNuNDbOK2fe410l7 KCh5V0aW51LWbCGEfedeIkmQ9fDnwsufY5+ugFOrvhxmIBgcRMyjMTNoQzF7RHc7TCLG T3kwYY82uZD5/hM40d0jV2o2SdpQMmKKUThUK7wqvzTyKb94mT+Hdq/DU4BX6gEXiuHo UxW6qxIo57Xc1+0fisfTHGfnACMuwsOqrJ/M4dG7Tl+gPp33+OHyv0gPkhLGLWZwLXtG GlEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=ELwpUcpY; spf=pass (google.com: domain of linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w14-20020ac87e8e000000b004281105462asi2598460qtj.16.2023.12.30.23.29.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 23:29:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=ELwpUcpY; spf=pass (google.com: domain of linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13648-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4745F1C219AD for <ouuuleilei@gmail.com>; Sun, 31 Dec 2023 07:29:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 405CA2F58; Sun, 31 Dec 2023 07:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="ELwpUcpY" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.15.3]) (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 3C55C17C2; Sun, 31 Dec 2023 07:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1704007702; x=1704612502; i=markus.elfring@web.de; bh=PcBUvluZb/BvdgF7ktzLibEt8A6a4VGufG/N/XU2tBU=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=ELwpUcpYPoNstTo91UNCbohC7BFOMxxWrqAkEmEOqjWz3nqiDvzL2I3euvfKyNmI nPi3A5ivgBq/LZiGsIH+l6YnzuXg1opvuAi7X/4VvtW7ALscdj5B/jiaihEIzg0lz VORijwlqpsLv+KQaO2212muYJ6Cg9HbiH2txaffdryuEpvzZ7xoU0z08mFzTcL4ox fF8zl/KPXt/VQjrzzIs3E03Qxl3P27dx7FEcVQ7sRTvlHWN3wOEyREq5yBH0YydYI fbAACO6kC25hBxQ7qjDYWo1MaXkovH0U3VBByJSjb0IKAGyhK9namzw9ZeDnWb9Va LA0hLj24xtUhjcSbZQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.90.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MkVwo-1qxSnY0oKE-00mBMi; Sun, 31 Dec 2023 08:28:22 +0100 Message-ID: <53be5f98-6359-48b5-955e-fd203d99d3cb@web.de> Date: Sun, 31 Dec 2023 08:28:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: cgroups@vger.kernel.org, kernel-janitors@vger.kernel.org, Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>, Waiman Long <longman@redhat.com>, Zefan Li <lizefan.x@bytedance.com> Content-Language: en-GB Cc: LKML <linux-kernel@vger.kernel.org> From: Markus Elfring <Markus.Elfring@web.de> Subject: [PATCH] cgroup/cpuset: Adjust exception handling in generate_sched_domains() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:pgnSzo2W+vneiGpO38IiNDAlEaIXKSMMACiIapp8BWsnXekDcdT PbTKnujXFwSFjr6dNhr2LWeXpGIYfELudkL0U/datOqgwQAGOG/p9DwHtGBFh/9TQQafMBx pd+MTC5ua7UFSk/OLfcvENKiCpoFoOWzzkxvHQ+qqoVir1t+VcPONx+YOK5gSR+1EnqEaYv 0Fq2o9AvO1SPmzhnL2LyA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:MF8NwxLMoUE=;Vth/hMGB+E6eKMV2W7MGJ4MxLZ9 hf387lQW9S4mRbLHw+Wk1eXh7IbH+bgBJcy+74ziZppgtw0VnnxAe5jSfvj68WT4yCJJ/Nwvc BWJ8IKnFwUDWr2Kk70SQv2jfBC3WA6dZPSjPXCb+esuBBnLv4YTDuBhQigtyV+y0Za3A10B7A yxAq/Fk+Jmim1yWVSd5OBavzsMkvdSjw9V3xIz5/cVckRMsEIgheJT3wFUqxKTZNpG5t32mcD ggFRvYvU2FysZZp0bB6dShfetu8WG1oot+Kw62+/MVsh35d8/UKxNvZu1nmD1aQC5kPFwh19n TEmjEgHyRG2oPSMt5VXucXMoHBS6l+HuGcI1OUk917w28P1DWe5nXfCuhhrZHp5IFPvGXtaRe MPUjozzfWjDMuT5F7TKq4A/rICf6lRPeWfhSB1brZp8x72mfmQX3E4hmM0RN3SPku4Fro6kjt VPN8BRJJP+jg/+KqDgIYxt7OC1L9F9oHSMtJ9xALb9kv7ftI5A14kT/9u5E8m5RcZfBfUq7Ob 4TrJM7zUO4dImuHeG7tmPDlDeKTrH2RhgBCia8zAlLdHTh9h59+MWSXsD6QP6Frl1ZkkRnhYc B76CGZ6ZHAyKp31HgPvYCYw6SOoXHzKc2BWKRGFXu1gaborbduJsWr02wcmKT7wnXORtwM/Ul dCRVeLp1kzUfsFUq4iC8Cj2ve5zwMG+zly/IfCUpF4q7Fdu2AxS/zJsC6Kvom89eGf8twuRb6 4jdUSIsetjqDbx910SJ/COQuAeUSNqHW0w/6HO7YQMYmsjYE34UAxFrGOVbGAJUDrRP616MyE AgikrA491MEz8xjVuqhULxPJ/BrThtIt4OrEZz8nnv5YIrTf3j79DA+CKuryk/mx5MeXcEKeT 7z35aZi/HPSiirS9mGKOQ4ychsjertrc23Jb4ZLEVaRdgUobNWgsbRFS3Fv8APXd+S5im2PiT uy8gWQ== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786781622028182301 X-GMAIL-MSGID: 1786781622028182301 |
Series |
cgroup/cpuset: Adjust exception handling in generate_sched_domains()
|
|
Commit Message
Markus Elfring
Dec. 31, 2023, 7:28 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net> 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 <elfring@users.sourceforge.net> --- kernel/cgroup/cpuset.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.43.0
Comments
On 12/31/23 02:28, Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > 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 <elfring@users.sourceforge.net> > --- > 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
>> 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. … >> --- >> kernel/cgroup/cpuset.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) … >> @@ -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) { … >> @@ -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; … > 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? The development opinions might vary for the presented transformation. I suggest to reconsider the number of relevant variable assignments here. Would you categorise an extra statement still as a desirable implementation detail? Regards, Markus
On 1/1/24 03:56, Markus Elfring wrote: >>> 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. > … >>> --- >>> kernel/cgroup/cpuset.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) > … >>> @@ -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) { > … >>> @@ -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; > … >> 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? > The development opinions might vary for the presented transformation. > I suggest to reconsider the number of relevant variable assignments here. > Would you categorise an extra statement still as a desirable implementation detail? My understanding of the patch is just to avoid an unnecessary call to kfree() as kfree(NULL) is basically a NOP. By jumping inside the "if" part of the conditional statement, however, it makes it a bit harder to read. As generate_sched_domains() is not in the fast path, I would rather have a patch that can simplify the logic than to make it harder to understand. Cheers, Longman
Hello, kernel test robot noticed "canonical_address#:#[##]" on: commit: 85f67f5f644dba9e15b9fa957f4af4745a330157 ("[PATCH] cgroup/cpuset: Adjust exception handling in generate_sched_domains()") url: https://github.com/intel-lab-lkp/linux/commits/Markus-Elfring/cgroup-cpuset-Adjust-exception-handling-in-generate_sched_domains/20231231-152941 base: https://git.kernel.org/cgit/linux/kernel/git/tj/cgroup.git for-next patch link: https://lore.kernel.org/all/53be5f98-6359-48b5-955e-fd203d99d3cb@web.de/ patch subject: [PATCH] cgroup/cpuset: Adjust exception handling in generate_sched_domains() in testcase: cpu-hotplug version: with following parameters: compiler: gcc-12 test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (Kaby Lake) with 32G memory (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <oliver.sang@intel.com> | Closes: https://lore.kernel.org/oe-lkp/202401102216.c93598af-oliver.sang@intel.com [ 32.391748][ T310] RESULT_ROOT=/result/cpu-hotplug/defaults/lkp-kbl-d01/debian-11.1-x86_64-20220510.cgz/x86_64-rhel-8.3-func/gcc-12/85f67f5f644dba9e15b9fa957f4af4745a330157/0 [ 32.391787][ T310] [ 32.412091][ T310] job=/lkp/jobs/scheduled/lkp-kbl-d01/cpu-hotplug-defaults-debian-11.1-x86_64-20220510.cgz-85f67f5f644d-20240110-32485-1y7a2hd-0.yaml [ 32.412128][ T310] [ 32.449795][ T8] smpboot: CPU 1 is now offline [ 32.455650][ T230] general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN PTI [ 32.467476][ T230] KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] [ 32.475678][ T230] CPU: 0 PID: 230 Comm: kworker/1:2 Not tainted 6.7.0-rc1-00370-g85f67f5f644d #1 [ 32.484571][ T230] Hardware name: Dell Inc. OptiPlex 7050/062KRH, BIOS 1.2.0 12/22/2016 [ 32.492601][ T230] Workqueue: events cpuset_hotplug_workfn [ 32.498139][ T230] RIP: 0010:generate_sched_domains (kbuild/src/consumer/kernel/cgroup/cpuset.c:985) [ 32.504106][ T230] Code: b8 ff ff bf 05 00 00 00 e8 98 60 e6 ff 48 8b 54 24 20 4c 8b 25 64 fb 71 03 48 89 c3 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 a1 08 00 00 48 ba 00 00 00 00 00 fc ff df 48 8b All code ======== 0: b8 ff ff bf 05 mov $0x5bfffff,%eax 5: 00 00 add %al,(%rax) 7: 00 e8 add %ch,%al 9: 98 cwtl a: 60 (bad) b: e6 ff out %al,$0xff d: 48 8b 54 24 20 mov 0x20(%rsp),%rdx 12: 4c 8b 25 64 fb 71 03 mov 0x371fb64(%rip),%r12 # 0x371fb7d 19: 48 89 c3 mov %rax,%rbx 1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 23: fc ff df 26: 48 c1 ea 03 shr $0x3,%rdx 2a:* 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 0f 85 a1 08 00 00 jne 0x8d5 34: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 3b: fc ff df 3e: 48 rex.W 3f: 8b .byte 0x8b Code starting with the faulting instruction =========================================== 0: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 4: 0f 85 a1 08 00 00 jne 0x8ab a: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 11: fc ff df 14: 48 rex.W 15: 8b .byte 0x8b [ 32.523422][ T230] RSP: 0000:ffffc900009afb58 EFLAGS: 00010202 [ 32.529307][ T230] RAX: dffffc0000000000 RBX: ffffffff8546fa20 RCX: 0000000000000004 [ 32.537078][ T230] RDX: 0000000000000002 RSI: ffffffff84bd2ac0 RDI: 0000000000000005 [ 32.544847][ T230] RBP: ffff88810c9e4e10 R08: 0000000000000000 R09: fffffbfff097a571 [ 32.552619][ T230] R10: ffffffff84bd2b8f R11: ffffffff819c9c87 R12: ffff88810c9e4c30 [ 32.560388][ T230] R13: ffffffff85470010 R14: 1ffff92000135f84 R15: dffffc0000000000 [ 32.568159][ T230] FS: 0000000000000000(0000) GS:ffff8887a5600000(0000) knlGS:0000000000000000 [ 32.576877][ T230] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 32.583270][ T230] CR2: 000055eb6b0d5000 CR3: 000000081ac5a001 CR4: 00000000003706f0 [ 32.591040][ T230] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 32.598811][ T230] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 32.606583][ T230] Call Trace: [ 32.609699][ T230] <TASK> [ 32.612477][ T230] ? die_addr (kbuild/src/consumer/arch/x86/kernel/dumpstack.c:421 kbuild/src/consumer/arch/x86/kernel/dumpstack.c:460) [ 32.616462][ T230] ? exc_general_protection (kbuild/src/consumer/arch/x86/kernel/traps.c:700 kbuild/src/consumer/arch/x86/kernel/traps.c:642) [ 32.621824][ T230] ? asm_exc_general_protection (kbuild/src/consumer/arch/x86/include/asm/idtentry.h:564) [ 32.627357][ T230] ? __kasan_kmalloc (kbuild/src/consumer/mm/kasan/common.c:374 kbuild/src/consumer/mm/kasan/common.c:383) The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20240110/202401102216.c93598af-oliver.sang@intel.com
On 12/31/23 02:28, Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > 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 <elfring@users.sourceforge.net> > --- > 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 > >
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;