From patchwork Tue Jun 6 13:10:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 103812 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3385917vqr; Tue, 6 Jun 2023 06:14:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74St3HNMU4ey6mEq16OZfKB2zpk5Em4AXtsxMrHXB/ntkfxMwT/AcGq3NcmTrpbXI2MF2u X-Received: by 2002:a05:620a:4889:b0:75b:23a0:e7c9 with SMTP id ea9-20020a05620a488900b0075b23a0e7c9mr1655242qkb.42.1686057289408; Tue, 06 Jun 2023 06:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686057289; cv=none; d=google.com; s=arc-20160816; b=qD4SSIEsSUIe6X4kXiuDEH7ah2cMoHgBFYothXJBUo5qvcDcDhgh5FgjhbC4wAwiva 9Xh6qnxjVyPtLoZ6NUnQwhi16IzpuykVmzp8N6Ys9dd4W2puUhEjpb7EO7w6NIqFYff3 uUCt/wqqqFKRNYH69R97dDb1EfrrieVYM+6uQg9un8NUAeu7jWY6P+qxKjYooCNS9CUf CM0p/8VWTVp+9oBK4/0cvSvy2yl5Nu+XELpnuiEB7vi99ADUg55E8GZ+r/6NVBAVahnl uJFrRXq1AoIOuHJ6GveaH8WUvox0SghYxvVRwH/y2UMjECRdRwzfFhy6NeBuPq0ly4EJ QIOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oN7iZB84feubgbt3hrHUM9UDHHNikcpPvsWxdIpKzwk=; b=M3nNJTLPGWqH+ZnNqpkufWBlQJmd0w2KAnx/qtwGNKwxFqmHWbEhv9c+b438MinCRZ PjvM7UAjy5ztdTxmdKOLdA2J9lBn3uDodWfFgaCubdZtK9lD4VGq4VulqdOrt9keWxcN 6cuqSkhJJbevrvmsPWGUxC2WOcyRzOhQnAxhuGB5ae0Yl8Syi+OcmiB+SqOUYTOcrNEk lX7BQ9fI0rNIM805Bf9+V9VNfPMRGlixUcYXdcG1ALnAmY0GP59Uhr2OdJt1iVQ+gLy7 AM4D5skc409Vp47YtGcKV7iWFPxtaCSxW7alVgBmcqhi3LEuJ0XrqHN9HVlf+5bI3kao NPFg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id os23-20020a05620a811700b00747a2434dbesi5727007qkn.778.2023.06.06.06.14.34; Tue, 06 Jun 2023 06:14:49 -0700 (PDT) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238280AbjFFNMH (ORCPT + 99 others); Tue, 6 Jun 2023 09:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238071AbjFFNLV (ORCPT ); Tue, 6 Jun 2023 09:11:21 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED03E199E for ; Tue, 6 Jun 2023 06:11:10 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Qb9hs4VNszqTlK; Tue, 6 Jun 2023 21:06:21 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 6 Jun 2023 21:11:08 +0800 From: Miaohe Lin To: , , , CC: , , , , , , , Subject: [PATCH] sched: use kmem_cache_zalloc() to zero allocated tg Date: Tue, 6 Jun 2023 21:10:57 +0800 Message-ID: <20230606131057.498054-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767959208262621608?= X-GMAIL-MSGID: =?utf-8?q?1767959208262621608?= It's more convenient to use kmem_cache_zalloc() to allocate zeroed tg. No functional change intended. Signed-off-by: Miaohe Lin --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a68d1276bab0..2a0060527c88 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10351,7 +10351,7 @@ struct task_group *sched_create_group(struct task_group *parent) { struct task_group *tg; - tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO); + tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL); if (!tg) return ERR_PTR(-ENOMEM);