Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp390494ybt; Wed, 17 Jun 2020 03:48:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzebXX86S70Yb1G96+XWF/xaS84G2MTmc87EgALsWYmz3HBUJYuapsXCgZ5YkGadvWle67h X-Received: by 2002:aa7:c986:: with SMTP id c6mr6800203edt.335.1592390888506; Wed, 17 Jun 2020 03:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592390888; cv=none; d=google.com; s=arc-20160816; b=Y2GcCCJtaqBvdt83uGNUX7U+iuB3p0CM+O/KO/fAgd2cV3rU/jfixVtwmZS5pDenFw z3vdlGiXZ/84/qV1XXDfr3kWSnEBdXXFT1ZoAZo9DGLJyK3rDe5U82B1EnwXk8ow5D7a 9EtrhakOxt6EGjJBPbPZ4zupdKXlP9+8N1Tlw4mx9+1EnVg+mbhmX/ALDnRxD3r9uCXA JHyQwMIArIJrZE6K7Lb9SYZzPJEHDSwVKi3S8Oa/SxIkPeagY0U13hMaD0VDBtLG2I7a T35vxUyHFzTlDD8FmM8eh678I3qJms3m0vWsIhAi62mekXkcsjwXjkQ2G/cxv4LL4Hbh 809Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=4K8LgaXX8giyqOfB5c4ndbsBBlBNfVHy12YGudK2bLg=; b=UQ3U2jU3Mtlsxw+THXuj671t389Wf72Lpdu2qejTHCPe0/oILcljwIBM6NhbAvQM+D YmlKRmEMKCxDwbSqMMjtqBHHq4FqGsv8GNW/ybmdbrSlJZQKApwy06fTOs/FMMoVsT6N fhFaaP2ODAYAIoKGN1qjanP7Rbbg+unp3QKPma8uC9mTKlcqs5YKIiaLJEToyav8I5ez EqoN3m+l33LWiNg4YZeRuaaQr5w2PbjjWC7raK2zNmSAZ2bYi7nlXTB4FZ0cHzgDscgu +0Qr7IKmBdrVRdPtVMzacLNXxfN+xweKp2lpXNS1C+BoFnati1x26wncYwr8WhGdrdrh /8ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si12451650edt.498.2020.06.17.03.47.46; Wed, 17 Jun 2020 03:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgFQKnw (ORCPT + 99 others); Wed, 17 Jun 2020 06:43:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:49082 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgFQKnu (ORCPT ); Wed, 17 Jun 2020 06:43:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A349FAAE8; Wed, 17 Jun 2020 10:43:52 +0000 (UTC) Subject: Re: [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO. To: Yi Wang , cl@linux.com Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn, wang.liang82@zte.com.cn, Liao Pingfang References: <1592378156-7748-1-git-send-email-wang.yi59@zte.com.cn> From: Vlastimil Babka Message-ID: <41628185-039e-6cb2-b615-dd5e8af338e7@suse.cz> Date: Wed, 17 Jun 2020 12:43:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1592378156-7748-1-git-send-email-wang.yi59@zte.com.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/20 9:15 AM, Yi Wang wrote: > From: Liao Pingfang > > Use kmem_cache_zalloc instead of manually calling kmem_cache_alloc > with flag GFP_ZERO. > > Signed-off-by: Liao Pingfang > --- > include/linux/slab.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/slab.h b/include/linux/slab.h > index 6d45488..1fa62d9 100644 > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -656,7 +656,7 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); > */ > static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) > { > - return kmem_cache_alloc(k, flags | __GFP_ZERO); > + return kmem_cache_zalloc(k, flags); Did you test this patch? > } > > /** >