Message ID | 20231130101242.2590384-13-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 514A7C4167B for <linux-mm@archiver.kernel.org>; Thu, 30 Nov 2023 10:13:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF9C58D0033; Thu, 30 Nov 2023 05:13:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D82FB8D0001; Thu, 30 Nov 2023 05:13:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD99B8D0033; Thu, 30 Nov 2023 05:13:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A96F98D0001 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 05:13:37 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8388C80168 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 10:13:37 +0000 (UTC) X-FDA: 81514208874.06.C1DF978 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by imf02.hostedemail.com (Postfix) with ESMTP id BFF8E80019 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 10:13:35 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PGY3bqwU; spf=pass (imf02.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.54 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=1701339215; a=rsa-sha256; cv=none; b=GO/OKfS47SuEX07DXKFvrAmqEidRDpm7/NjOErCHJW9jZ5ECnCUmVgOQ6BEyKl2s2q99iE PlGGqpW/2xuhgsHznClITiENM/kIQvjLFv9eF/ntuU7ZK2e2wkd/zvGPillbFn51Ijbrpq VYYC3NmeG3poumnaVG15HXb8SgObTdg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PGY3bqwU; spf=pass (imf02.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.54 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=1701339215; 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=vdihqx7B7KLgar9YSAGyUX0LBqL4R1+4PYzUkM92hCQ=; b=K1pTpZggHX6vZOHmuNaR9Sv5P/Reeu/CkupMJilsGXoKHszfKTHpEFazas6HGOeZzqOZn7 ZoW3LnyNYF6BZnABwJbCFNhQayuFPBaGzMwtPjz7WlABRZ5Yv7VU9gqoQRBem1w7zz6h71 AjoFavtVqu9tIeR9tsQgU2wCumxD0dM= Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6cd0963c61cso480506a34.0 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 02:13:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701339215; x=1701944015; darn=kvack.org; 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=vdihqx7B7KLgar9YSAGyUX0LBqL4R1+4PYzUkM92hCQ=; b=PGY3bqwUrI0ol2QZMFHeRkltxogRpSRPvu/FNCtJCpIJJ8kioPYd7WhIJEIvEQvB7e dZPIqI69IC6/h4A3l9siRDQsIJogf5XJuTzeelwIJFsG+/J6kstQn2K/bv6RRLELjvZ7 RgsJEQy67grThGt9dByFh6emj+5AXOfuzpC00hEbxp/gz0LwxzQG9AgCzUyr9dc57P9+ 4EeemSEgek8xCCpmLnTAG4rf2akB97FSq8QADUXoE/EzRHZryWexGF2ibe5ioQMw4j4x DkKzKcxJm9mVbW0PFlaoTvy7kzZgCQyVyeb1UlCkIuE3yd/LQOavHVAiuBxUZtZiiCs9 BjTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701339215; x=1701944015; 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=vdihqx7B7KLgar9YSAGyUX0LBqL4R1+4PYzUkM92hCQ=; b=rxYkavoSvFcLMkCW3k0gSygdvYDL6XdhMTu7WtRVReydT2E8iMsKraDaws3epsCfzu beyckGgL01Cl6IF5Y0YX7nknseMr8FqJs0EjW6y5anO/21nlGWLSshI9sGyu9YpOrLWj ZA3YNDj5pbovEU+zIf/R1Iv/3mYDeH1HrXPW6mvpAuBTgAZPF/Qal0BAqeeic6MpgsZc ACbaHKc67AKRXAkoo7tFq/G2m+3VMdlB9BNK+/tAAcV1UAJI+4DkQ4ilBGu4EWu7yhm2 7z6H2RRF2k1d+iU4cQGqtEmQxMVN//jg2g3632AlUQDqxKZt64DXPGctqeIAqFgKkceS Y40A== X-Gm-Message-State: AOJu0Yw0Jb5LE6WlWRI13Iqss99fHaDq9aDvluGJoG2qLUA/tKhJjB7h 3i6ata6HDsHK8fuaCTnWVUM= X-Google-Smtp-Source: AGHT+IE34+5OA4/fl0FgaRCmUxAwP55nM0ufhZGNZb3L1jlWRJdswT+L2DOUH6n6RMKqxXfN34vQzw== X-Received: by 2002:a05:6870:c45:b0:1fa:345e:5e15 with SMTP id lf5-20020a0568700c4500b001fa345e5e15mr18230739oab.13.1701339214817; Thu, 30 Nov 2023 02:13:34 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id r27-20020aa78b9b000000b006900cb919b8sm841402pfd.53.2023.11.30.02.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:13:34 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org> Cc: Matthew Wilcox <willy@infradead.org>, Mike Rapoport <rppt@kernel.org>, Yosry Ahmed <yosryahmed@google.com>, linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH v3 12/21] mm/zsmalloc: convert obj_to_page() and zs_free() to use zsdesc Date: Thu, 30 Nov 2023 19:12:33 +0900 Message-Id: <20231130101242.2590384-13-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231130101242.2590384-1-42.hyeyoo@gmail.com> References: <20231130101242.2590384-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: BFF8E80019 X-Stat-Signature: u9ij9ysz4xccwrdhwmibrcbiutjxwtmh X-Rspam-User: X-HE-Tag: 1701339215-469366 X-HE-Meta: U2FsdGVkX18OuclU08mPvH7vV53qCnr+sjbIjPRctHPorTtRHBiGTx5sh2yfyfZJCCbFkHuPnZ0Lrqa2w4ODffhP9dxYrDtIIGzvoEH1s69wpymp1GQ+69tzZU+C/wXpkSzIfBoyQqghGK3nsbb18KdzV39yXb2lnoPgdI7gSfaepBOacucB6zY6U9/IXN2gj2wih9Rtz4IHE1nVfYY6+LhfUe0q5lzbp0/7CLzhqOab/68xpsoE+xsW3362PHIo9j9BEBZe2+ltkHWv9YbsRA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b8eYj26uFHwwUSfSAmRKroUtrhdZWxMNapF0SX8PLF+U5ZI6zpTZJSJ1OWsUuCOPmjfWMTVH4/P0Ddfwy9mO0hvlhZ94I7Rv/4RJK+VxJj5ShDXHyc2A15JOyR8iF+S2CYDTfOU40gSa2eFKxxuSQA8IVVzRGX6jx3ywXRuPg/xn+Ja5BDkxf7oRtxEM+WCtmJ1XXLj0c1ydGaLIVOpebda+1OJmxYMjW6VJV7h0/UxUGZUA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001926, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/zsmalloc: Split zsdesc from struct page
|
expand
|
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 8fe934df298e..1140eefa3a1c 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -919,10 +919,10 @@ static void obj_to_location(unsigned long obj, struct zsdesc **zsdesc, *obj_idx = (obj & OBJ_INDEX_MASK); } -static void obj_to_page(unsigned long obj, struct page **page) +static void obj_to_zsdesc(unsigned long obj, struct zsdesc **zsdesc) { obj >>= OBJ_TAG_BITS; - *page = pfn_to_page(obj >> OBJ_INDEX_BITS); + *zsdesc = pfn_zsdesc(obj >> OBJ_INDEX_BITS); } /** @@ -1597,7 +1597,7 @@ static void obj_free(int class_size, unsigned long obj) void zs_free(struct zs_pool *pool, unsigned long handle) { struct zspage *zspage; - struct page *f_page; + struct zsdesc *f_zsdesc; unsigned long obj; struct size_class *class; int fullness; @@ -1611,8 +1611,8 @@ void zs_free(struct zs_pool *pool, unsigned long handle) */ spin_lock(&pool->lock); obj = handle_to_obj(handle); - obj_to_page(obj, &f_page); - zspage = get_zspage(f_page); + obj_to_zsdesc(obj, &f_zsdesc); + zspage = get_zspage(zsdesc_page(f_zsdesc)); class = zspage_class(pool, zspage); class_stat_dec(class, ZS_OBJS_INUSE, 1);
Rename obj_to_page() to obj_to_zsdesc() and also convert it and its user zs_free() to use zsdesc. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)