Message ID | 20230516095029.49036-1-avromanov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp309550vqo; Tue, 16 May 2023 03:08:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7M4bATW92yBzi8sg1ZqnwL608XI+CK0tPZd90poyfblwDez9dLV33cKqCo4INlnLN3PImO X-Received: by 2002:a17:902:9a04:b0:1ad:bccc:af78 with SMTP id v4-20020a1709029a0400b001adbcccaf78mr21647054plp.58.1684231732500; Tue, 16 May 2023 03:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684231732; cv=none; d=google.com; s=arc-20160816; b=jTigC3Z3CXqZzSH7vtdhySRiwKg2mNORUQJF53Mnhn9bHrxoPuO0kOhyFeUKnP83Xw TJ8zV5vNCtp4QomUW00UxNGfSoUjsrGMS+9aXM750EECbDYxtC+ZhPl3iRB465ZqAavw KJ/ZhY7uE81lwJMrsthYc3anAmUKWimQnsQ6Y64fpFT6M2YR8QSrB9vucOSvdRxS/LWU Vm9ulZnKgAp7jiHbNHzyhSDvD3XUN/6scdto/LnL9PUs7eUUM1HlVa6VjSJQLt80VF/Z tCDhUMtbOtrbcgE5h38iv7rZ+kAXUpPs3Ka/f3lAAlpgcyrXcwvb9JJDUHPqxxLZ52GR Ziag== 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:dkim-signature; bh=4Bi0KK9m/M8I5xBIw0piOBV6vW2Jir8/WPsX0rbFo1k=; b=igmha4BAhwFxCXL1pWvcF0b2rYO4eIv8lfBXpoghSQQEYgywEICkaOQi4GDb55+I18 qXwaxEGj7qOIWHzujVMXcgk2R9IOnbkFyop9H9GehEgmlsjf5GwYfr8LOEookeVG8Q+5 AvGvAsvRhCwLnD7CB5eEnYmnBP1mYLrMpgNduwi3SJqQ002waa+fRd6kVh1I/VaDCM7l LU4na2w9u8/gsR4s/Yi5V8Ru8JvtqaNuDhgUkiygIdyZMZY0tiIzkOCPp/9uQc4WFWQm TAdLI1B3f8uR7RlQZ1C5APWUFy6VGF98j/nOopd5W1ZxedRx+R/Dw2Q1Bz4mZvTQwQOs XIxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="s/VOr+tk"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a1709026a8300b001a6458c9f96si17379183plk.37.2023.05.16.03.08.40; Tue, 16 May 2023 03:08:52 -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=@sberdevices.ru header.s=mail header.b="s/VOr+tk"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbjEPJvL (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Tue, 16 May 2023 05:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232161AbjEPJvG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 05:51:06 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34EAF3C3B for <linux-kernel@vger.kernel.org>; Tue, 16 May 2023 02:51:03 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 2CBC85FD03; Tue, 16 May 2023 12:51:01 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1684230661; bh=4Bi0KK9m/M8I5xBIw0piOBV6vW2Jir8/WPsX0rbFo1k=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=s/VOr+tkKmc+sNMYoBVnfmQUuBjwwpsVzTbONS2/OJn7L4+QlPVOZGiXY490MZdtM cEgpssWMGZTj4mkg9LZQK6ptOzWtM55QkVgomAyItHgmhG4J9qn/MPZu7MPqYWVZSm thOhr4ZK8qNH2zL+LIABBbZl/i7E14CwkjDlyMLjIgI8fyfOHtTKjWmxhUENcIQbud eLVAyt/Q2GHD8NtXXDEsuTikSzzm+eGF7+epetFFKCWJZjhSj6SBjkoGeTGLn6nIQk JM14aICafLpp1APvntQr8j3wA6mvcmWDeMDpWv1J3eGs1cH8BomFby6owW5XOiOI5Z 1rjmLTFSBk01g== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 16 May 2023 12:50:59 +0300 (MSK) From: Alexey Romanov <avromanov@sberdevices.ru> To: <minchan@kernel.org>, <senozhatsky@chromium.org>, <akpm@linux-foundation.org> CC: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <kernel@sberdevices.ru>, Alexey Romanov <avromanov@sberdevices.ru> Subject: [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage() Date: Tue, 16 May 2023 12:50:28 +0300 Message-ID: <20230516095029.49036-1-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/05/16 05:57:00 #21317490 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766044972995025314?= X-GMAIL-MSGID: =?utf-8?q?1766044972995025314?= |
Series |
[v1,1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage()
|
|
Commit Message
Alexey Romanov
May 16, 2023, 9:50 a.m. UTC
Better not to use hardcoded constants.
Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
---
mm/zsmalloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On (23/05/16 12:50), Alexey Romanov wrote: > mm/zsmalloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > index 702bc3fd687a..f23c2da55368 100644 > --- a/mm/zsmalloc.c > +++ b/mm/zsmalloc.c > @@ -1888,7 +1888,7 @@ static struct zspage *isolate_zspage(struct size_class *class, bool source) > fg[1] = ZS_ALMOST_EMPTY; > } > > - for (i = 0; i < 2; i++) { > + for (i = 0; i < ARRAY_SIZE(fg); i++) { > zspage = list_first_entry_or_null(&class->fullness_list[fg[i]], > struct zspage, list); > if (zspage) { This patch needs to be dropped. We don't have that function anymore.
Hello! On Tue, May 16, 2023 at 06:53:27PM +0900, Sergey Senozhatsky wrote: > On (23/05/16 12:50), Alexey Romanov wrote: > > mm/zsmalloc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > > index 702bc3fd687a..f23c2da55368 100644 > > --- a/mm/zsmalloc.c > > +++ b/mm/zsmalloc.c > > @@ -1888,7 +1888,7 @@ static struct zspage *isolate_zspage(struct size_class *class, bool source) > > fg[1] = ZS_ALMOST_EMPTY; > > } > > > > - for (i = 0; i < 2; i++) { > > + for (i = 0; i < ARRAY_SIZE(fg); i++) { > > zspage = list_first_entry_or_null(&class->fullness_list[fg[i]], > > struct zspage, list); > > if (zspage) { > > This patch needs to be dropped. We don't have that function anymore. Do I need to sumbit v2 without this patch, or will Andrew just take only the 2/2 patch into the branch?
On (23/05/16 10:11), Alexey Romanov wrote: > > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > > > index 702bc3fd687a..f23c2da55368 100644 > > > --- a/mm/zsmalloc.c > > > +++ b/mm/zsmalloc.c > > > @@ -1888,7 +1888,7 @@ static struct zspage *isolate_zspage(struct size_class *class, bool source) > > > fg[1] = ZS_ALMOST_EMPTY; > > > } > > > > > > - for (i = 0; i < 2; i++) { > > > + for (i = 0; i < ARRAY_SIZE(fg); i++) { > > > zspage = list_first_entry_or_null(&class->fullness_list[fg[i]], > > > struct zspage, list); > > > if (zspage) { > > > > This patch needs to be dropped. We don't have that function anymore. > > Do I need to sumbit v2 without this patch, or will Andrew just take > only the 2/2 patch into the branch? Let's hear from Andrew, but I think v2 won't be necessary.
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 702bc3fd687a..f23c2da55368 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1888,7 +1888,7 @@ static struct zspage *isolate_zspage(struct size_class *class, bool source) fg[1] = ZS_ALMOST_EMPTY; } - for (i = 0; i < 2; i++) { + for (i = 0; i < ARRAY_SIZE(fg); i++) { zspage = list_first_entry_or_null(&class->fullness_list[fg[i]], struct zspage, list); if (zspage) {