From patchwork Thu Jul 13 04:20:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13311267 Return-Path: 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 50892C001DF for ; Thu, 13 Jul 2023 04:21:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2E738D0003; Thu, 13 Jul 2023 00:21:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB77E6B007D; Thu, 13 Jul 2023 00:21:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C30C98D0003; Thu, 13 Jul 2023 00:21:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B430F6B007B for ; Thu, 13 Jul 2023 00:21:05 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7EEBFA00EC for ; Thu, 13 Jul 2023 04:21:05 +0000 (UTC) X-FDA: 81005288490.26.B861EFC Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf13.hostedemail.com (Postfix) with ESMTP id A4E2C20008 for ; Thu, 13 Jul 2023 04:21:03 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=beHvFnUz; spf=pass (imf13.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.179 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=1689222063; 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=Fp6PZAIRFvwp6nXKJbH8kpHOkBbqGND+2E3aTyuENRc=; b=LUCxlgI8rzGMzxGkj5L3xclN6N3Msp+ONL8CBn3jw+LLu56cJ4a4lSexoaykBwd95sWVYo HWimJNg+BM9CcBLN0yXaNE6coI6LxGFmaZKjA6BRR/QliaKWwzoxy45u7lTtjvWgfXkbIj 2bXVsudgVyDrPXMg4txaf/6IFTMgd0c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689222063; a=rsa-sha256; cv=none; b=QbLFn0NkxtMj8n7niJQlLb7Gt1jFXzb2E6fuMz9753+kZGkoXCCuoDTeK4CnsurXXO/hco tiyaHGxILTFl4M6Txe5l/inPj4f/3PTe1YUqNXcFVVYMtGmOKetSR3jVztK/0MTxZxQnA7 pCk4r1YUxKepmta9BDbsUTZiEeeI60M= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=beHvFnUz; spf=pass (imf13.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-66c729f5618so324045b3a.1 for ; Wed, 12 Jul 2023 21:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689222062; x=1691814062; 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=Fp6PZAIRFvwp6nXKJbH8kpHOkBbqGND+2E3aTyuENRc=; b=beHvFnUzX8qISZCLCnJid1ohVYLhkgcwmfXqTrvDAtYU+uy5Ztlr+SfvlDI6cKoJtE iskvrecQA0bZlZDRwbgVQ/g0J8Ut1SML5FIOq+0eqy2Ai4g2gpA5Ox886og6Bj8JqBFi sjI/ULVjLyBzR4xJcQL4vrDSQDjpBAQYJ4PhWsz/JEJdXAkSZMREN/u8JelZdypkyQyP 4GH04a4CugoAB2zIdF8O/gijVzuTdNJit+bFzqRN5hyYOdK9hIryfuvUludPF6xLzVrV nGDS9XIWOlCAvE5/ZdkX/fU2CE9ooGRBeoqkeqU/LhoRvMHmj81pl+Q1+6Hl9v4bRPFW WFYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689222062; x=1691814062; 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=Fp6PZAIRFvwp6nXKJbH8kpHOkBbqGND+2E3aTyuENRc=; b=MvVLE2waLBCJZh0ShzguxmQXoChN7wbCoLqw8gluRJwkuU3EeES674pmllcxDmDVZK 8kD/xJkfqYBSAgeUpHraOqjNCPyfSqSSxlst5WBfWS8bFjyfjEA8gXTSMxL/TPLtlLeo 4uwM5+TiBBtIejYbOaAIk7sIzPU4R2Qkg2xfyEDWosvhVQsO3C1XrqdBk9xPWsMhDRap rxYnc2rrLDFIz1TF3LKJa+OFOAlkfTrOEIWwl/eWCkz1dU8pj2pZJFkKtEcraJXVfzCE Htywn8dZmlgcVIRKnJv3ZBOV85VCHCgrTfZ2Y0SGOBKDG12+fteImXXwLJ+laCVMFt7F WAoA== X-Gm-Message-State: ABy/qLbScIDj92pcU2ihcdDF/dx4ruNtIAOv5dlE07j7PapHgsPEv7t+ R6dy2PTqDAKVNJmRiP9UFGd1/8KqU7jfraY82qsbdw== X-Google-Smtp-Source: APBJJlEdRUxFFFRpu7uJbEt4B2QPnF0T3XjBRUtDhiNmPbHRgO1w2Gtj/dHOyvp3B96gwDB8K4OapQ== X-Received: by 2002:a05:6a00:150a:b0:680:2b80:8479 with SMTP id q10-20020a056a00150a00b006802b808479mr876923pfu.19.1689222062432; Wed, 12 Jul 2023 21:21:02 -0700 (PDT) Received: from fedora.. ([1.245.179.104]) by smtp.gmail.com with ESMTPSA id u18-20020aa78392000000b006827c26f147sm4346601pfm.138.2023.07.12.21.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 21:21:01 -0700 (PDT) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Matthew Wilcox , Mike Rapoport , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH v2 03/21] mm/zsmalloc: replace first_page to first_zsdesc in struct zspage Date: Thu, 13 Jul 2023 13:20:18 +0900 Message-ID: <20230713042037.980211-4-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230713042037.980211-1-42.hyeyoo@gmail.com> References: <20230713042037.980211-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Stat-Signature: 1igcndf1g4a8udxnio1zost9benikb54 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A4E2C20008 X-Rspam-User: X-HE-Tag: 1689222063-795541 X-HE-Meta: U2FsdGVkX19/2iaG1wYUx48N8kgwqTSiOkPRNVZIvSDUcLYffMRbDNXFwIb+qPgPpjPG24dAqvLWMg9nHenwjniSji8sSC4D4lOrdh1NHrm3M3UfUs2hMBjHQmdrFOsIAVbHmPslC3wAStgLcfDCCvuF41cZ4qa4Jq5mAWNCUgDujqt/+ACse4xQArTDapsX7g7qbO1hkO008zvseUGxZds37pDAKiGShv9haD3HZ6chURadk811qpPFaiCkRlNXf/Ncm8H8ZlO+/Z/HtX3JnLivPExMzDtqhMokD4QjWQhbu6Dta4Fs4s5Wu1Iiji4Ib1zEFQHaF78mUJKdCr72kk6blHC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Cujl2FRJ03RcVSC/taIS75dJPsPjZ2gIKziZrcA4+Gx9/L4Th/B9IgG0+lmUuwQZ+Vf7b69BYtXDcFdeRC3oubMHq10qZn8i+XiGwHWmuki0IHO9V6SFaeru/mb6CuhhvlgwIs/4sgkY/XVObBlbtL+mVkrTTUTUKkBOpdbPnD+DO7IHEtmFKa5rOQD4WV0RBqslvwClXuDiXRQBLO/x+/LdzudWaE= 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: Replace first_page to first_zsdesc in struct zspage for further conversion. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 11c203e79c39..8f7d9b79d849 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -234,7 +234,7 @@ struct zspage { }; unsigned int inuse; unsigned int freeobj; - struct page *first_page; + struct zsdesc *first_zsdesc; struct list_head list; /* fullness list */ struct zs_pool *pool; rwlock_t lock; @@ -512,7 +512,7 @@ static inline void mod_zspage_inuse(struct zspage *zspage, int val) static inline struct page *get_first_page(struct zspage *zspage) { - struct page *first_page = zspage->first_page; + struct page *first_page = zsdesc_page(zspage->first_zsdesc); VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); return first_page; @@ -1024,7 +1024,7 @@ static void create_page_chain(struct size_class *class, struct zspage *zspage, set_page_private(page, (unsigned long)zspage); page->index = 0; if (i == 0) { - zspage->first_page = page; + zspage->first_zsdesc = page_zsdesc(page); SetPagePrivate(page); if (unlikely(class->objs_per_zspage == 1 && class->pages_per_zspage == 1)) @@ -1398,7 +1398,7 @@ static unsigned long obj_malloc(struct zs_pool *pool, link->handle = handle; else /* record handle to page->index */ - zspage->first_page->index = handle; + zspage->first_zsdesc->handle = handle; kunmap_atomic(vaddr); mod_zspage_inuse(zspage, 1);