Message ID | 20230220132218.546369-16-42.hyeyoo@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 606FBC05027 for <linux-mm@archiver.kernel.org>; Mon, 20 Feb 2023 13:23:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 035C46B0088; Mon, 20 Feb 2023 08:23:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F284C6B0089; Mon, 20 Feb 2023 08:23:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF2256B008A; Mon, 20 Feb 2023 08:23:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D02BF6B0088 for <linux-mm@kvack.org>; Mon, 20 Feb 2023 08:23:16 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A5875A2821 for <linux-mm@kvack.org>; Mon, 20 Feb 2023 13:23:16 +0000 (UTC) X-FDA: 80487736392.17.D443CA0 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf06.hostedemail.com (Postfix) with ESMTP id D83D918000D for <linux-mm@kvack.org>; Mon, 20 Feb 2023 13:23:14 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eWZwVmzd; spf=pass (imf06.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676899394; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kWZBaCBY7/lyMA0ZpKm/ZUcumuceWXxJ6yxCXnHQeas=; b=wK75bp+HbjRZsSqOzQ7A5YkqgTrTzr5kB/giMtI6OOVLgonsqBhTulBuGwSYCDTkZWWnCK u+87+1NMmkiAmQGG0EZnlwPxmiAv9MvNcfXWGEjKxcwVc/p/J/QFKTYv8R33sTUqo/S8n/ eEIRy7RnWZ8yhozx6yONjR2RrnLZYU4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eWZwVmzd; spf=pass (imf06.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676899394; a=rsa-sha256; cv=none; b=DFdPpU9jMWDXZDXCc3ueCaA4zCRI3fsWhce3YPDMyOrVlHKgopivKXib76FRNnGCtsVhOn hJGnqBRKs7jdMp/JagnGqKeB7v0FaIQIRqz4vPQ28esx/lFgb6JMkfi16dpGYoAWef96me Fq0mcgnMOCuxP5g9Rz48xVTh/HuTDBA= Received: by mail-pj1-f51.google.com with SMTP id f9-20020a17090a9b0900b00236679bc70cso1996987pjp.4 for <linux-mm@kvack.org>; Mon, 20 Feb 2023 05:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kWZBaCBY7/lyMA0ZpKm/ZUcumuceWXxJ6yxCXnHQeas=; b=eWZwVmzdBtx29OPYkhcCaTBmF8xvpeo324aQIy1yrjzla3Rjrau6cCgKcBTNdsac2J dcJ41ttYXeiDJsbUwCyj/PFlpGcbEJkJlc1cLfbkAHcQWBBWU08V5ibWc4h787dU3Nbq 66aGcCLSQmq48LV3zgJJ97agPaSb+l1bPQnbuguvI58kJWsxpGhRVKm4Xs/ZJjkUaaed HDVsy7n88tM1fCo+blhsoCrLF2q+8TQbLBSefe8MmdpZpS64yO2D7iHLbu952TsMU0KK Nt2h8IjLYfre01RlxDe8+4uJw8HeBBsdUrRQdHHg8EjUJaz84XIGDjrAXmmXrt3kmgi7 IJYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kWZBaCBY7/lyMA0ZpKm/ZUcumuceWXxJ6yxCXnHQeas=; b=rj3XaF7VtX1uLY5w46rjuH95/p94G1637+nijI/aCNM4e/MeGNza96yHpQwv6YlEgH 1Bd0cle0f7r7qzYxaBpvzOh0DE3CKzXQuhLTEOSmjkm1zxEPwvdGkXBHIbL8Xb7eed9Y Us6G7rfxemX6xrNhwUDEel+OWPd6EIQbv66M5ZGTA5FVv8TgZz8HrTIGW7h0jOIFqQJl hRshH3A7wV9tv73bcbc6FZdvJMwaNn48SpEoLoat+qhxP7oS1jfPed9DwIeNguhQdUpc oetiwyw41d3ZkpiNJqqF1Mgn5cxVnZkUCCgeHKRkG9XRc/wYDXr9ZQ9aTb/9kuYKlWUP IvLQ== X-Gm-Message-State: AO0yUKXxc0hH+FIFHPMOp1Sk9vaClzYye7HJZai0zWEgu0xF7DKXqND7 Zzm1229V1Gm+1pEALeIMYICVr+e7r5o7xQ== X-Google-Smtp-Source: AK7set+eK6eHfyxZbKLPgP0633S6/Mvq1EDoug3kacaFpBhr4X4tfoZG+YbM4FyAcowPsEPWLN9Rlg== X-Received: by 2002:a17:902:cec8:b0:198:adc4:229d with SMTP id d8-20020a170902cec800b00198adc4229dmr3466642plg.24.1676899394329; Mon, 20 Feb 2023 05:23:14 -0800 (PST) Received: from test-ha.kr-central-1.c.kakaoi.io ([210.109.63.229]) by smtp.gmail.com with ESMTPSA id x2-20020a170902fe8200b0019c13d032d8sm6125436plm.253.2023.02.20.05.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 05:23:13 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Matthew Wilcox <willy@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH 15/25] mm/zsmalloc: convert __free_zspage() to use zsdesc Date: Mon, 20 Feb 2023 13:22:08 +0000 Message-Id: <20230220132218.546369-16-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230220132218.546369-1-42.hyeyoo@gmail.com> References: <20230220132218.546369-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: opesi77py6jdq6b5nfq169kdnes4t9dr X-Rspam-User: X-Rspamd-Queue-Id: D83D918000D X-Rspamd-Server: rspam06 X-HE-Tag: 1676899394-813493 X-HE-Meta: U2FsdGVkX18IGbF2uQG3vZQppgMgwt8FPQsoLClQC5oCND2e5ERzfuI+AOPZodsn8C1ErWCC8hb5IpwAQafKDyJzPUnqtStfUAXRQmatMCOut6QAJQBZdkZrbOR9EdKai+AorzkjhA4q53EyOPFl5LpBK9DOQnEQI4pwA4jm2tA3IkNcl8fVSsBzdBtSR7hB5gq+G+hihngoo3/9hLOyWvZfhRrDYGd7753lpYBrnHVMC108xlxBdyayZtcyTms4A780jO9DFDloQXWY8oWvrvPLS2zk38oXOKhjVo6dkhiTisCI1Y9Acioj5Et24iPYC4klHV+ph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xcsLreYqLGJ1V6ykn9wf/YeKyU7UbGyU/zXSzqroO4/+FwXUAGMLJ5/9Rb7t8AfSAoWzP7RlGTgf3T66EnV8QRNW4gZFzS32DbBKw7DpPF8FaDcIO6scdCGZ+u6tRwvGF2O03g7jhiJlnBRVl7WvdH8F0e1MZk3KvayuN7nqLV6wgCC4oAIXeAMYoT7zLHeHwmD7TQjm82f X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
mm/zsmalloc: Split zsdesc from struct page
|
expand
|
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index ced7f144b884..7ec616ec5cf5 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1148,7 +1148,7 @@ static inline void free_handles(struct zs_pool *pool, struct size_class *class, static void __free_zspage(struct zs_pool *pool, struct size_class *class, struct zspage *zspage) { - struct page *page, *next; + struct zsdesc *zsdesc, *next; enum fullness_group fg; unsigned int class_idx; @@ -1162,16 +1162,16 @@ static void __free_zspage(struct zs_pool *pool, struct size_class *class, /* Free all deferred handles from zs_free */ free_handles(pool, class, zspage); - next = page = get_first_page(zspage); + next = zsdesc = get_first_zsdesc(zspage); do { - VM_BUG_ON_PAGE(!PageLocked(page), page); - next = get_next_page(page); - reset_zsdesc(page_zsdesc(page)); - unlock_page(page); - dec_zone_page_state(page, NR_ZSPAGES); - put_page(page); - page = next; - } while (page != NULL); + VM_BUG_ON_PAGE(!zsdesc_is_locked(zsdesc), zsdesc_page(zsdesc)); + next = get_next_zsdesc(zsdesc); + reset_zsdesc(zsdesc); + unlock_zsdesc(zsdesc); + zsdesc_dec_zone_page_state(zsdesc); + zsdesc_put(zsdesc); + zsdesc = next; + } while (zsdesc != NULL); cache_free_zspage(pool, zspage);
Convert __free_zspage() to use zsdesc. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)