Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6959913rwn; Tue, 13 Sep 2022 11:28:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CDo7rsT0BDH+45YMYoaH/YyyKDUuYFjb2h7gTkphkagRWfEi4Abn5708fzxFQY/siO2Lf X-Received: by 2002:a17:90a:1b65:b0:1f7:4725:aa6e with SMTP id q92-20020a17090a1b6500b001f74725aa6emr534093pjq.179.1663093726457; Tue, 13 Sep 2022 11:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663093726; cv=none; d=google.com; s=arc-20160816; b=ydcYFX7Lb96WzEWdyiKCgLI1/v8jfIzDbW0NBMq/91mxE2tZn8f68rYk3ohd/43bAm 9Q6Z72Gi0hUjKkNd0AO/lxdoi8+OWyHv71EEo2Is4BHRzbJZZwf5ntGZ0v83zPBeZAfP uClx/7tyNQRFBCX3+BrWUZuH+U44b6Sk5k3RoV5k7rxmBhty6+yV1dqJTBtenDk0Gtbg wEUufWvYIYmSokUOsb9sWteAD0XiOar+kJ2KjBIMZftClc8zksn3CnSDPS+WoCjV3GW8 8TvKAleJm1wiGzQIPT+36HjHimziBEcc+V71yqT2VvstNyGbmKWUaQCcDT+hOYq44B7P 7ocQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IzEJvDqgB6ybGEn8MXPW6RmZp/5/rhlD6Xi8EY6Ywio=; b=RxBbl96PpNombSl+jrTqnONzPtY1uKUk0rcdhol6z+bZLypFQQI6Vc6UUm1PTQtMr3 zd+K3wwCRFCriL9vnPsPYKxDhrFR3QwyUnWOh1JnlWDiCIB7WhlQdbzdULe167EInBs6 bg1PyaOSuJM9BLpqkq211D/kwTSYicl/2Om5bkWYiX1IaJ9MRtw33y2it6Py7cjD4NID r5xeTAFPBsh8wxFga4EgnvwrIuD0fZ9r6fUoXAroLxQ8O0LbGQ+fXgmdKBYQ/yuQ8VJX 1/0ThYTQhr+KJLU+jnawrSgu130tU8eDZRV37vp0JCN7FZit8MJs+pzq9dXt6wJlyBxM DFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mAlGN2bb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020a170903209300b0016d74515d06si11736317plc.614.2022.09.13.11.28.33; Tue, 13 Sep 2022 11:28:46 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mAlGN2bb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbiIMSLI (ORCPT + 99 others); Tue, 13 Sep 2022 14:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbiIMSKs (ORCPT ); Tue, 13 Sep 2022 14:10:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1B33AC for ; Tue, 13 Sep 2022 10:16:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF32561525 for ; Tue, 13 Sep 2022 17:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A57CBC433C1; Tue, 13 Sep 2022 17:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663089408; bh=Uo0FmKOIOqO2xt98KZDO75WMovCewe/BPwr12WzqD+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mAlGN2bbSywVp6ZYPZdCV+CdkaorThXnHVupWVu4TBqYco2iF+6ffjoU204Ci59xD QYVctAzw25geHyf0q6pAXfz06rbQk2VZUv9nk6rUhCdG72swQ+NTHuQedhHAFwXnqU IF/lpEivXclmgCb/wuCpAzd6fi4BtKrZsIsQR6wiXTYvkGHlodvO9LRQylSKEgfssc XUdPM18I8xWqEMkAWVCTaSyxWDYNTcQmonggXcRUrOCZiaqGLdvKkpQeH+LJs0X2vo CtPlfprzSMSNhql2Z5OvJh2J6PtKhdNHeSFgLRmhoe6K/tL5axr4CwUmdSVVai4dN3 EJ89jtbcc9gJA== From: SeongJae Park To: Dawei Li Cc: sj@kernel.org, akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE() Date: Tue, 13 Sep 2022 17:16:46 +0000 Message-Id: <20220913171646.47472-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, 14 Sep 2022 00:21:58 +0800 Dawei Li wrote: > Damon regions are dynamic objects which can be created and destroyed > frequently, a dedicated slab cache is created by KMEM_CACHE(), as > suggested by akpm. > > Signed-off-by: Dawei Li > --- > mm/damon/core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/damon/core.c b/mm/damon/core.c > index 0b1eb945c68a..20163c3c9aa7 100644 > --- a/mm/damon/core.c > +++ b/mm/damon/core.c > @@ -1283,8 +1283,7 @@ bool damon_find_biggest_system_ram(unsigned long *start, unsigned long *end) > > static int __init damon_init(void) > { > - damon_region_cache = kmem_cache_create("damon_region_cache", sizeof(struct damon_region), > - 0, 0, NULL); > + damon_region_cache = KMEM_CACHE(damon_region, 0); I was about to say about the 80 columns limit, and this fixes it as well. Thank you, Andrew and Dawei! > if (unlikely(!damon_region_cache)) { > pr_err("creating damon_region_cache fails\n"); > return -ENOMEM; > -- > 2.25.1 > For this fixup and the initial patch[1], Reviewed-by: SeongJae Park [1] https://lore.kernel.org/damon/TYCP286MB2323DA1894FA55BB9CF90978CA449@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM/ Thanks, SJ