From patchwork Thu Nov 30 10:12:24 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: 13474200 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 23C33C4167B for ; Thu, 30 Nov 2023 10:13:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 658C26B0459; Thu, 30 Nov 2023 05:13:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 606BD6B045A; Thu, 30 Nov 2023 05:13:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45AC66B045C; Thu, 30 Nov 2023 05:13:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 332046B0459 for ; Thu, 30 Nov 2023 05:13:12 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1321CA0165 for ; Thu, 30 Nov 2023 10:13:12 +0000 (UTC) X-FDA: 81514207824.23.D8EFB61 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) by imf24.hostedemail.com (Postfix) with ESMTP id 2028D18000D for ; Thu, 30 Nov 2023 10:13:09 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CKVhQa2z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.166.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701339190; 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=0QRwjIDBZfH3KHXQixzfUgriCEY1OpCqJmvwU4YsPh4=; b=ELyxR95oUdwkcm/Hg9MYaRt/RkUQC/wbuX0N1u3L40zMMK6i+liALkk9l9XkGpivSobqUH ockXVUu1ebDuRvVN5vWT7ibMzS8g5xk2n6nMcBVpqwtLK1ELnQMTUz0twiHokmB4qTp5NZ Kcc/S3pJSumyEPidO/6kX6yqa81cfGw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CKVhQa2z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.166.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701339190; a=rsa-sha256; cv=none; b=gcwR1PNT0cST7TNwYAGkrVaXR86We0dcxCmFfq8o4nQbGZLzadiQpACmWgjyvSwqWiYgZU EdXKBCY1LADJ0++KP5SyCp0WX7ervnlKJP9XEWtdS0XR5p0E/Hpf7s9zec9K/oLz2IlS3C d/8kv/Wl0psRkSWJ8B1mT8THNCyH7FY= Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-35cbbb308e2so1846155ab.2 for ; Thu, 30 Nov 2023 02:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701339189; x=1701943989; 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=0QRwjIDBZfH3KHXQixzfUgriCEY1OpCqJmvwU4YsPh4=; b=CKVhQa2zHeuSxBK6Bha9ga1rvso349Pb1rN5gOGc/o+kTf5/4lY0h9oSqJxIFCGlpf XgU92TVxSxnetUmLZVCKVxZDT/CDBKB1lliOtHO8iYBIP9VPM2+LnTkL+Ahd1fihYzbQ E+ANYoIW1WyBdU5tqUibDmQaRZsS5aD52CfCkw+pJM7PZ1bYJoDQvKwWt+maiqioOI7i yrXj+YYdYr/mtHLYQmpVqCg9dqyeVEeIqZVyymJbGDH5N+k+0yy8vHzrV5Zk3DY/0nAt q/0ebUYWwiovh8anUKMKAczcGym9ES5gZJAZTBcnhKDP2WaPe4qWAzDgi072TiGdaxS1 blBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701339189; x=1701943989; 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=0QRwjIDBZfH3KHXQixzfUgriCEY1OpCqJmvwU4YsPh4=; b=KvIkts31dfwpjN++zBQOrjLXr639Dm92vCycMQBGZYTL/jO/tuBGWNbtwtOoms1flq 62/dX8h7PdnZd4H0LsY5aFbyELRELWzuR1AnTlcF5Abq3NtEBrsd+yCDhKx2ghTnt+Ng y9J0Bc9D3L16h869j2PE1LIdJj0/spAFngCUMLbIi9WuacKAXATusZl1skU8cuEBM/HB jfYwBP3dLJ/SyO+Wwbj4ss267utysLYC7T0eSZZsIQ/Go8xVtTcXvx9YKXg2VCxp2LEU 7jU5t+0o04Y5frx0F+I/DRtQlRS9bzALRenwJiY6GmlHb+1o4ruTl670gJVNI5Yjp05D qi6Q== X-Gm-Message-State: AOJu0YxtOFE9upfI7qOMSF1G8xKs2KEHIFFx23LXrPJG29Om74NusU7g wHSBudy9Nf/eAHEsBRwIISk= X-Google-Smtp-Source: AGHT+IHbebPkjUiF9mNqY2J9Mw79ZmAdS3WmWlNY+8tFKTs2TjE7U5B18tiwviQu0Fnp9m3ckXJqug== X-Received: by 2002:a05:6e02:13eb:b0:35c:c47d:f58e with SMTP id w11-20020a056e0213eb00b0035cc47df58emr13432878ilj.5.1701339189129; Thu, 30 Nov 2023 02:13:09 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:13:08 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Matthew Wilcox , Mike Rapoport , Yosry Ahmed , linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH v3 03/21] mm/zsmalloc: replace first_page to first_zsdesc in struct zspage Date: Thu, 30 Nov 2023 19:12:24 +0900 Message-Id: <20231130101242.2590384-4-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 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2028D18000D X-Stat-Signature: e3bhfxq99iu6x5sdukomestocr8jg67p X-HE-Tag: 1701339189-768182 X-HE-Meta: U2FsdGVkX18FPwIhn0uHyZ0nPdASfhBL1jhdPr4d9YDes48AcLcleRRirw5PkObMbmS1SIlB+UjNuZ0HnCbkfqT1JvzVXIfxdvNQWMnEjSHHLkUAAPgmp/mKmVLpFkzoeUFFar2CiB5IPSPXIFHa000VAk2UdHKu1f0Pa82GY8xO1uX/mVky0SbW4wPs8AJPkHEugaZ6IctqeXMPEd2y1mHkfR8BnnFhTxdMBVn2yCVxb1jf9DYTOOPLNu0WCiF5FS1/v+HSM9P8Nv01+k568QOLlExVICBqYPJz58SFIpZdRq0wlhyBFWwX3rSgjHfahttPGk/EVU5lnb4mVTJ9Yp1h6BYcnTNL8mQrXvCbNWGMqVRb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ZuD/0Gv8xau2VPvF8Lx/j7Ea8VmYZslYjm1Uz8J5BQx/B8ebmz1ak+RopLhfN1CANoyDHUIURVLc0kOmMLwjunJz1/Vn/Q0kOTjcz0uYZM2bX8EQd5ALMx8hjDTQpzdz2OYnm+La4cduy+UDTg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000098, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 47df9103787e..4c9f9a2cb681 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -317,7 +317,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; @@ -516,7 +516,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; @@ -1028,7 +1028,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)) @@ -1402,7 +1402,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);