From patchwork Tue Apr 11 09:13:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhaoxinchao X-Patchwork-Id: 13207234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DADFC77B74 for ; Tue, 11 Apr 2023 09:13:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21DDD280065; Tue, 11 Apr 2023 05:13:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CE6028005D; Tue, 11 Apr 2023 05:13:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06FFF280065; Tue, 11 Apr 2023 05:13:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E938528005D for ; Tue, 11 Apr 2023 05:13:47 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B5CD4160B0B for ; Tue, 11 Apr 2023 09:13:47 +0000 (UTC) X-FDA: 80668547694.05.B621249 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2059.outbound.protection.outlook.com [40.92.18.59]) by imf15.hostedemail.com (Postfix) with ESMTP id EA21AA001C for ; Tue, 11 Apr 2023 09:13:44 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=AVPxnYn4; spf=pass (imf15.hostedemail.com: domain of ChrisXinchao@outlook.com designates 40.92.18.59 as permitted sender) smtp.mailfrom=ChrisXinchao@outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681204425; h=from:from:sender: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:dkim-signature; bh=ysWDO1E1Qguu9cbVBb9TCcMU5YCWzLbPnhRc9UX5iwk=; b=8PmI3xJEeWInXEGlzD/Vv49kJC1rLzOuDReWoo4S0XzLKI6V+Fd6Sx4C/3GIO5GgBNhdI6 dvmMq81WwkoR1b9uOFWD/gyaFXV5cRQ2wScdVRjCiXSNvElHQe32oP3oDYCljKL88VCLbX 2gxYe1U2H35bdVapSyQKWKKL6nKg+HM= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=AVPxnYn4; spf=pass (imf15.hostedemail.com: domain of ChrisXinchao@outlook.com designates 40.92.18.59 as permitted sender) smtp.mailfrom=ChrisXinchao@outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1681204425; a=rsa-sha256; cv=pass; b=SS4ehPpZzF3tR+KoVJgABmjIc9WCkbg5PXdAwFIRiLOTBXwBC0M+aqKP5ZFRuO0aUUonWg MDRWazvFPGdMdeb6eWmYTlOMtIu6722JdvvDWQu2dLVToe7z26bSxtvBUipAj2v7aBbA49 VYHrlo99RUfSRSW+2m9r+mZSjQbCbH0= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BlhBdoc2ghhdJSD76OfmDL+xGUMtS70RI1+Bg9mGEDA+jnx69OvYAsniw5g/gEVVJDyr30pUXK+vWEMZYDPxzG3/LO96wv5qunzomNCaq/q/mu2Yw0H63N+PtdAWUfT78Ea1zNnbi88g0iHdXohubbtivGWe83wiQa/6mY/dnRHMCmoPVd5cV/XTuZR8tgSumbecFG5Z9QhSEKeEN2iPo53hrzWbtvYgG6p78s8VPQ2ozS7E6zwNTJh7C4Y7EmWifrrf4O+Ike05vFHxs4keBxYZutZVNFx27tP47pDnxsjNe1nlxR9azKIdZ0YveRdkqDRFIWEJOzcX1ytqO4jn0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ysWDO1E1Qguu9cbVBb9TCcMU5YCWzLbPnhRc9UX5iwk=; b=PXBMpJyYXbBJC2TClni4KgGTBP5oXT2F1QXK0/pQ2SB0f+4qBvWprYmjvC83HxQkgbiLU645hORp7ApFKtnFqQDBvv5S3yJD+a/EBUGJfY7UD2kg5Tf5StsThOvEp4qZfvvg77DOLyp42QxEtBDyJtdOsY0Yd8543TAWYVJVB20Fg2188FFQp0ptol21vAGboR7qZ2mmVN3sw46gx615DmNLBuUIxILkOiuKEjN06fJjgSY/MJDVtr+obePP2k9/XqN3CnOOOLgqYt3CiSbxeLzZpGhXfW9FqsIoYFBEbemXtpKSrqzMvgrWx8+9gLvdmurc1RDNxpHdZ6IUH9OlQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ysWDO1E1Qguu9cbVBb9TCcMU5YCWzLbPnhRc9UX5iwk=; b=AVPxnYn4nLHMfAUFRIpNSW64L5maOexcybcyCVUUzDq3q33TDtL+bka7PiQt6DDSdFQLNY+bm7YhXNXYClUIDs5qWOPsZY/AYAUwWcVDXfQPA0CFWmVMDPsYD2bpnb7HsvaW7M2YCgq2to4d0+INqzEdH/VKaYwZ2IhOoPK7cWCUZ0yXR7H+mJQ9BdGlnXH560fnCTVjVbhX7t23ZNxOBBTnXFZCk/sZipWaZwUplFQz+IE0wZwU70XAmdjsc/9Mp9c8nAfBBr5g+nIFNTVy+psjV6qlOTcIB9v5D7H9/xSHgAcbPtLYweqxPmfeMnMHDRzxGcBCwhfWyw2Ly24GpQ== Received: from DM6PR22MB1836.namprd22.prod.outlook.com (2603:10b6:5:25e::21) by SJ2PR22MB4283.namprd22.prod.outlook.com (2603:10b6:a03:538::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Tue, 11 Apr 2023 09:13:42 +0000 Received: from DM6PR22MB1836.namprd22.prod.outlook.com ([fe80::4b7e:925f:eeca:488c]) by DM6PR22MB1836.namprd22.prod.outlook.com ([fe80::4b7e:925f:eeca:488c%4]) with mapi id 15.20.6277.035; Tue, 11 Apr 2023 09:13:42 +0000 From: zhaoxinchao To: bagasdotme@gmail.com Cc: ChrisXinchao@outlook.com, akpm@linux-foundation.org, cl@linux.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, zhaoxinchao Subject: [PATCH v2] mm: Fixed incorrect comment for _kmem_cache_create function Date: Tue, 11 Apr 2023 17:13:22 +0800 Message-ID: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-TMN: [N0Oww7afXAT05yCJA3nlqQzV+FjJ764q] X-ClientProxiedBy: BY3PR10CA0024.namprd10.prod.outlook.com (2603:10b6:a03:255::29) To DM6PR22MB1836.namprd22.prod.outlook.com (2603:10b6:5:25e::21) X-Microsoft-Original-Message-ID: <20230411091322.13232-1-ChrisXinchao@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR22MB1836:EE_|SJ2PR22MB4283:EE_ X-MS-Office365-Filtering-Correlation-Id: 6009e71c-beca-4861-1030-08db3a6d0b3d X-MS-Exchange-SLBlob-MailProps: WaIXnCbdHrMtPHFZlEBY4ikO6W38docLDNgQsW6hSQfTRDBcmM+Yyc6tGqeHTNpDzXlQ9muiIDrTQuvrm28iO+8weQ3kGqbsnXrym5JjEMubcsfwIDkPpsfOtV2ISWK/2DtPbSeKhc+qFdtlsQu4RSk7b0E+5Jnx5bc0giGdZgTtvR3zsx+4okRQtitC1A05woVVFiw5w89SiCAV+qTgqnR9m5bG4PeRI3b3jWLv+nSAuiA8qX1MBBSvg49AO76nZI/SXktt0DiXMosyCrjuc9zXC+wZLfAzd7DsY0UAqzrISnniyDcimMZxRme+sgYWcjzHKA/g5E6YDzTVoJ4qqsdR8x/xffmCx78EZQyQjztnFHkUfFtLz6I05dCejeXYEmk7w4NFgXKvumfT3looDpYhrnQ3PY4TGnewJnrme5Mi8RDsxQfntTNSsA9atE3YmOS7+J3YE4kRQQOLQZI70MbLhzoARdjNz8gyFBp85KyjMfzgZo/DHKc68ua+TfXx50maK4KtFQ3FpEdGKmg+AlxD0GNjSP/fMwCNbxvg8/c4K7rmOLPnE6Nkalj5yZgkEvhAGaouTsegyMlOyLDlwY4wTLoUy8tTunhO9CRrDYLjg2H/6XQaAHmy10vUoFWTLfDrg3y+2XZLUYRznyYHIus58PW58C80UlZ6KPI8Paz+5v96uRLmS+NIgzCjcgzFOSg1heYJZba0gxRg+cUcF8biZY4vtQvP6slqyovbKEQ7n3s3YMjBFXBb2ulY6Rb8AHEX7vdPpYk= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1ftmT4OdBPdY3p2CejwwFha9/LlPPrRhVf4vUW8AhWYIVO5Ek/73f3CQZSvnnWyLGKNAz17HGpcZckx8NnRoHA6cyKQoZ9VL/N3R/o6Hg4AvC0qUlyjiKA5jgTB29cDnTLxJeuWM5OgIN1JR3gGRPI3vzgp81NihIO8Y/QSuMiIh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jH8hXQK3D5O9oSpYjdOSjuJ3DBktQEVNqrL6or7l8UCgIgi9zRzxuA//dY17F0xOXueD8i7eEEYsleGD4JObJGHLpNwxlu7DvJ7SNgyLFva+XfMVWDculQbxM9LQGpFX9IOeo5cDIBi4CMqrzriI1KIPc/X44wRrbGfvtdla8XtDlrXUS+mB89a8C7Jleg9OgTOys7LROV9+f6RbOdTpj8Qu2ErMTgdWRlaYnoTF+u0wvG25eq5t1nAg5AtKGn0O3pOVAhBvfLn4P91RkRAvBENFvDLRegOGczSPChI/vWL0rN/pXbEDqrcUNoln0ew1AptlB2KLDlEYP6QGIFH/s/UJq2PkstdtZz8EFRtqocS3yFCuY6F+D4yCsX+4NshuA/Qd9lTA4Y5LqVHlK/XF6aqghYWKy98yRFn6cYpd2F6adkn1ZzHZOui9etSrS6xgpVZmxTAKL+ofAdhzVwKewHsfgQww67oRCNtn/0CW/GV0SId8HpSg8bB9hTAgl7hHt/003w3IuiYrJhkcLiolAP7e/1a/XFudbjZjaTiIzkBJHIXo5XhYJIbY/WTbQMTwbGSSf8VViVBU/8F7crTjIppjs+MdoflF3UsFHjW7SVItFY+pWvKIyzj0JbePrsNwr6s2bJRmV8s/Y7hULkOLjFupB7Z95Mc6RAeWBSFwYqQHUQtRJ/xkOeVA= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6009e71c-beca-4861-1030-08db3a6d0b3d X-MS-Exchange-CrossTenant-AuthSource: DM6PR22MB1836.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 09:13:42.2303 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR22MB4283 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uwNj8TZ3rBCIpNd+BswlfihCNzEm0ePI LidvQ1s8 sTtQyrMb2WsqWUeAwH8iZ8NtPl/rLLzcB7E2Rg+35yw0M8GiaHyNJE2JVgzGLriGT7DH6cJ2pVnsD7BEylf6uKPel7PhhtG95XyDfwWV0rfKZw39BnDYdcetQqSCy4JCpNSzSEi2Q9n9Cv7prr5xcEWd4jUJOuD9CacuWtaSArZA5wjef5nDiTkfZAPgTBZvyL8GKSJbdwSTwpNHZuP2EkuLIK3Br1o1+pdIvCDxW4mu7+NtEg7skHDYvD+VpdoH7pWdFoiDGjrHiziT+bTMFjfa2dFuhhVOWZWGwX+OfXWHrifITSj4G6aKzQtwB5l+yw74OTrhMGRti74Kbmc+f7Ah0zrbYlEA6cSIzEw6kjJZkFH2cbMDGDoYGJsfq3unF9dEWX2tXCDUaBKPZx8+1ZTUEjLWqooXoqKQHjXhxyjoR0bwK6pIMAt4UaRNhAQPR0DiEWvkfcM/AakNQmz01636noKpXhuxVY0vbtfi57P/BmhpGeYREwfTqw0FOocjoOJ2peOm0u6luKXo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: zhaoxinchao Actually __kmem_cache_create() returns a status : 0 is success nonezero are failed. This function has three return positions. In addition to successfully return 0, the first failed position will return - E2BIG, and the second position will return nonzero value for setup_cpu_cache function failure. Signed-off-by: zhaoxinchao --- mm/slab.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/slab.c b/mm/slab.c index edbe722fb..399daa4d0 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1893,7 +1893,12 @@ static bool set_on_slab_cache(struct kmem_cache *cachep, * @cachep: cache management descriptor * @flags: SLAB flags * - * Returns a ptr to the cache on success, NULL on failure. + * Returns zero on success, nonzero on failure. + * This function has three return positions. + * In addition to successfully return 0, the + * first failed position will return - E2BIG, + * and the second position will return nonzero + * value for setup_cpu_cache function failure. * Cannot be called within an int, but can be interrupted. * The @ctor is run when new pages are allocated by the cache. *