Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5419370ybe; Tue, 10 Sep 2019 03:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZLDKmGvLR2UnMfzHYTW0M7c4jZ0JwJCyCCCwfpAhYaRaORAbOF//T7bjzHXTu0FM7xhHF X-Received: by 2002:a17:906:6852:: with SMTP id a18mr23055717ejs.229.1568111281156; Tue, 10 Sep 2019 03:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568111281; cv=none; d=google.com; s=arc-20160816; b=iblUdRFpORz70wRFBOt7ghL6WljZZXif6Fr/XmMC5H2QlBs5bxU2XsPL7mzRjq2XsB +oQYaBlH5y7F0eOr+ak8qsYn/k/gQGD5a7U0fZkfJcmou5qWfcqL9f62+nfrt2Q2sdxL lV7CQteHkPR2MI2nO0D56jOolvjMdzd60FDBYk36w5cEZfU6VuYsY58fCB4ysldQ83bv HremgYLjwv6w4HnpEHoU3s3oDAKjVgkNU3rJ6/XR94/qt/oIPO5Ta/NoUPqo3+AUJoJ1 +/I6ZdVCXHd5Hg88LD3aJYcAGwU0MFKVAL/EaI4sOI1tKsQJfT/Cii4zu/BrYIre24gu PuyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CsXKhS0XQfiMyJ7mpn68yj+pi0x2EB9djLY2PKEnIvE=; b=C3ZbsdrL4hLOM5kAFkujOeKuVST9ltsJpN4VMf5veVcfLCR61LuktmDPy1r2+LT3DP 7EgLQ66uaJ+AKeU0mIRNXkRsO3uKcsU2+KC5ApxbFX3C88H2YI2oPkZNoo7Rtl8pm6m4 PsyVB2vRHX3bIoua1mb8prEDRnpo1CcG876DptF5FXX2JJUbyW2cDTWeNw6RRVQbeo8t 3rB6n0j0x2Kt6EYxCwqcszM10dUaC0QXn9JVT3BwbmiwKe4BfGu1H44D24J0KtqBy5sW BOTAJzWx4ZPbRa1zlulgyAODvQD8fuoy4SkZfNQczCTrix9eg0R2WY1dQ0ZUSVajsGHV KC/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJvhTiFV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si9685301edr.426.2019.09.10.03.27.36; Tue, 10 Sep 2019 03:28:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJvhTiFV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390656AbfIJA7e (ORCPT + 99 others); Mon, 9 Sep 2019 20:59:34 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:32860 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbfIJA7d (ORCPT ); Mon, 9 Sep 2019 20:59:33 -0400 Received: by mail-ot1-f68.google.com with SMTP id g25so14350015otl.0 for ; Mon, 09 Sep 2019 17:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CsXKhS0XQfiMyJ7mpn68yj+pi0x2EB9djLY2PKEnIvE=; b=NJvhTiFVojZBMKp/UMfPBAcdGNpXPqcLf0l+uBgrLnIMN5Lb/QdwFjIZfVicukwWFB 0BE0Y+Sg6WKACTgNtrnrQa/X3VChC2oACDmCmxD459s/W+xYAeus4fF5TZyW2b0UMzo3 AokqCH7lHtfOqpzhG6lNtzaLHCY+vqKQTvaoID9hJcP42QZU0b49qjMFU27/HD1prwuN cF9l/F7lbMEB3j4/Sp9MMP2j0UrdTfhf/mVzkC5EKEfd48ApkUwlyu7MEfr14ZNnUh1f 9GCjnUzgAi4/Zb6Bp8NLgbDeBtmQF/6zTxqr/uZo7U8A+ABkluT8xBMZRSwUuYwMeKSF BuSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CsXKhS0XQfiMyJ7mpn68yj+pi0x2EB9djLY2PKEnIvE=; b=q5LMzZ3zr7529z3wITwxQH0wPuX3oPKRoOyTze1STotju9QmtSGbjBer+/aVBzMeam Ra1uHcI6IpP3CmI5YvEiyqW/srYURPDuM/pzcP/rOy2dfjMaFKBvp8uihFZMvoMNQZ3j 6c5V6e/9CfaQXmdNbpCtswe3MkH7+CE+Dyr7ljQnvkm7+uARW07uXGhC9yKcW9ZMTBL7 n40ElPbw6qm/VeHA5BQ5Fm1jR95YrrgHxnRfLfdf0hSStCyHF1CZHHrWunJARJnxwIX4 YRJLRl31ZeI26GB+bPvbpEEaIo+1NaiTtDDvsjQKYbpGlaEOQeUaKaJeau6RbDb5/8nu Wu3Q== X-Gm-Message-State: APjAAAXdDLr6au2aK/z26DivGBfvxpryx3AMpelDMBbZ7+Hikt2X6le/ vz40XXLP9QMoOGhnqO/fcZN8ee4pj9975+4FXEc= X-Received: by 2002:a9d:1ec:: with SMTP id e99mr17314668ote.173.1568077171489; Mon, 09 Sep 2019 17:59:31 -0700 (PDT) MIME-Version: 1.0 References: <20190909170715.32545-1-lpf.vector@gmail.com> <20190909170715.32545-4-lpf.vector@gmail.com> <20190909195955.GA2181@tower.dhcp.thefacebook.com> In-Reply-To: <20190909195955.GA2181@tower.dhcp.thefacebook.com> From: Pengfei Li Date: Tue, 10 Sep 2019 08:59:20 +0800 Message-ID: Subject: Re: [PATCH v2 3/4] mm, slab_common: Make 'type' is enum kmalloc_cache_type To: Roman Gushchin Cc: "akpm@linux-foundation.org" , "vbabka@suse.cz" , "cl@linux.com" , "penberg@kernel.org" , "rientjes@google.com" , "iamjoonsoo.kim@lge.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 10, 2019 at 4:00 AM Roman Gushchin wrote: > > On Tue, Sep 10, 2019 at 01:07:14AM +0800, Pengfei Li wrote: > > Hi Pengfei! > > > The 'type' of the function new_kmalloc_cache should be > > enum kmalloc_cache_type instead of int, so correct it. > > I think you mean type of the 'i' variable, not the type of > new_kmalloc_cache() function. Also the name of the patch is > misleading. How about > mm, slab_common: use enum kmalloc_cache_type to iterate over kmalloc caches ? > Or something like this. > Ok, this name is really better :) > The rest of the series looks good to me. > > Please, feel free to use > Acked-by: Roman Gushchin > for patches [1-3] in the series after fixing this commit message and > restoring __initconst. > Thanks! > Patch [4] needs some additional clarifications, IMO. > I will add more clarification in v3. > Thank you! > > > > > Signed-off-by: Pengfei Li > > Acked-by: Vlastimil Babka > > > > > --- > > mm/slab_common.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/mm/slab_common.c b/mm/slab_common.c > > index cae27210e4c3..d64a64660f86 100644 > > --- a/mm/slab_common.c > > +++ b/mm/slab_common.c > > @@ -1192,7 +1192,7 @@ void __init setup_kmalloc_cache_index_table(void) > > } > > > > static void __init > > -new_kmalloc_cache(int idx, int type, slab_flags_t flags) > > +new_kmalloc_cache(int idx, enum kmalloc_cache_type type, slab_flags_t flags) > > { > > if (type == KMALLOC_RECLAIM) > > flags |= SLAB_RECLAIM_ACCOUNT; > > @@ -1210,7 +1210,8 @@ new_kmalloc_cache(int idx, int type, slab_flags_t flags) > > */ > > void __init create_kmalloc_caches(slab_flags_t flags) > > { > > - int i, type; > > + int i; > > + enum kmalloc_cache_type type; > > > > for (type = KMALLOC_NORMAL; type <= KMALLOC_RECLAIM; type++) { > > for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) { > > -- > > 2.21.0 > > > >