From patchwork Mon Dec 16 15:04:39 2024 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: 13909886 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 51AF7E7717F for ; Mon, 16 Dec 2024 15:05:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB7486B00A0; Mon, 16 Dec 2024 10:05:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D3F066B00A1; Mon, 16 Dec 2024 10:05:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B939B6B00A2; Mon, 16 Dec 2024 10:05:37 -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 8C60C6B00A0 for ; Mon, 16 Dec 2024 10:05:37 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DE58E44E0A for ; Mon, 16 Dec 2024 15:05:36 +0000 (UTC) X-FDA: 82901144928.08.ABBA8E2 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf29.hostedemail.com (Postfix) with ESMTP id 305B0120025 for ; Mon, 16 Dec 2024 15:04:52 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PmX21Dvk; spf=pass (imf29.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.180 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=1734361503; 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=gVDIhOdN2uAX8Aw1N9nVuvKRYeq4rM6oWNSpQXGIXHA=; b=ScH8P1AfWzyg/vJ3GtrXHgghZtULjzfsdq+d3Mt1pL1CLAeq/9WHHeXjLMc/wXK9qLxvnH CXiLOxovXneb+1LWXtHGxajNWjdnTIsHbOmsSn2j3kZy+k+dRkMC4wPWO+FjqIlPtThcLC eqda/TIuyLvTVCU/meWO+/hehk/U4gY= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PmX21Dvk; spf=pass (imf29.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.180 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=1734361503; a=rsa-sha256; cv=none; b=A+c1SMQtMyWTvIZ0IFGfd0aWJEMPEVDuS68VHkp5sdRgdMj/ACOJ985j/SRoDuvtRclF/v hFWXaJehy6d19csndNoUYEqm63bQ8Vatszla3NLcSfXXGg1S5Ou5xWevRlWAXW9yObkaDb MLgv6WQPx3KeGOkeS+D4IFHHbIXoor4= Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-728e1799d95so5013427b3a.2 for ; Mon, 16 Dec 2024 07:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734361533; x=1734966333; 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=gVDIhOdN2uAX8Aw1N9nVuvKRYeq4rM6oWNSpQXGIXHA=; b=PmX21Dvkg31aTyYH9zIxI+Ypm8Ssvz55QcY83fys5BQtniythFgMYn0JWtF1e9kJ/1 ot5PI3wQZp4qzsmAUJMSIl1dyfGYU6EsCjcq0lh3/uXTyCjfZAyseZGev4MWrmFWdLDY 0vejCFudsoMzTYYjeHiF/qNaZXthTmPWI5HIGk5mwNL4iZRp6seiKv0EHC+HQL4MBm+V A6XHKKuw65CeRo70WLeXFClHaFc/tGAq5YRP/E2qscQl1AEHnMJR42mHQY7e27dNqBUc bUA8BiJKs3mEPLTaBHysyZE2KLPvZ5BE1ujHH2a8jCJFLpaiu3OXoT2wi0wZRV3xedFA QJXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734361533; x=1734966333; 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=gVDIhOdN2uAX8Aw1N9nVuvKRYeq4rM6oWNSpQXGIXHA=; b=mIrs0N3f5athqKPdXDTV3dVuQLXtca/c8CYwVBM7HbixnS40K/J5cTMVaBwo/mtfaC 5XpWdOY7dJ9DiIS2O9FRwgsJGOLGOy802+AltOZL6pZFFCq48rjdjdDt3JhuoxfVVjm5 9jF+77NVsPf9fRLi1yhHCl/DiqSk5YGYrdJ0o12DXz6sa1/LMbhZT2HeolNCBu02aB1N /1StZKCJ48pnoAwnskpxJ6zqFRlclIB8PKeXYVhKZDI6O6Pv6LGYA0YZmDz6Xy6auJS5 UWQ7cdnVmCeSRNTgbDJ+7TFVsQmA2vU/QScedSIsx7b4VciHHRL+G8XTSWPmjBNtf262 mnHA== X-Forwarded-Encrypted: i=1; AJvYcCUGnhcDGVkhCCycho5qb2zYE+NwZUJaIhSHwvkHr76iVSt4QOXy12jzZTDbvXu1v4M46PdolFEIkA==@kvack.org X-Gm-Message-State: AOJu0YyNTZ8bbw9xkkD+BOSYgxirg7WlnAmIGNVDIQ1x/QGOII51tsiL +YXsPje7FMbDdEekR40lAt8MMQUzofJlgDlh5HEeG+P4rNXi12dO X-Gm-Gg: ASbGncvHDOMcmMnH+IzMYHjOLAV7KXuCk11k/GFZIFyyWdQqIGS+DLS/5pufHF/7aD3 E7DNbg1tfxioEPpb++HRRNMv+pZYDVRooKPIIKZgzvZBsXh+0geuXYhdQN0Vu06md8ju/rqCjrc h7UoVzW1ASkpYIGasTeFvOxMeu0VFfLNiarDPtO4ik+4QQcFF21VGEEh7UFxVsSzEu5b6bXlmi4 1UQaJF7PsLUQfRycyG7C6TTgJMaK+V6QESd2hGGGHNJ9yDDZCZHpFbXaoCbgdW4kEM= X-Google-Smtp-Source: AGHT+IHspep/0w0h+As3uPnNtbfPK2qsZiDD/ybT+qBO/FZrjZ6OW7hLqGvq51tGb4SkIBtbHR6EEA== X-Received: by 2002:a05:6a00:4209:b0:726:41e:b32a with SMTP id d2e1a72fcca58-7290c0e179amr15571546b3a.4.1734361532952; Mon, 16 Dec 2024 07:05:32 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918ad5ccdsm4845518b3a.74.2024.12.16.07.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 07:05:32 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Andrew Morton , linux-mm@kvack.org, Matthew Wilcox , Vishal Moola , Alex Shi , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Alex Shi Subject: [PATCH v9 mm-unstable 08/18] mm/zsmalloc: convert init_zspage() to use zpdesc Date: Tue, 17 Dec 2024 00:04:39 +0900 Message-ID: <20241216150450.1228021-9-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241216150450.1228021-1-42.hyeyoo@gmail.com> References: <20241216150450.1228021-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rsp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lu uLP2hYuqMYomQDdSDkrffKxE//QXXuYWr2PzzmYyEthA5CJJ8BMO5HuYJj8pIevcbRcN8uysItGRnUANwmkcwZ9ebKxgSuQJ52BcUeNB98fEwGC9AAGWdioKZb/Rd84LTkAwKmOyPZ/l1m43zbQSqDFYLGmvkKjbyK2TlxGkagV3M6SAVKtZFIGWgl3iEvyiXQcEIZ6iLsnIM/oYmrJuyIIrKyrKlaFH59JCGhDbrZjFyeS0tyg9DmKSDosji6bHWoxU1CmTTvtqsKU04/wkQfb2mm30U6sEeC0bFHzFKffzqPxww9OUav0OcXpyipB5sqpSZQxqswsjqcwIgUO5EzVkc5Uu4BkHyz+kmALTtCzIhjI84VoHATEJNtiXB/sqhO+EJ5223mD3NYT/B591E/90ewlZb9wSaLaFvBOi3AUBVI/CnoKIgxR88/t/zR3S0RD3aZEBdEoP1GWCDTHyTZ62csTSA63jKuPakuwFVcYiJiZGJ4hdyCxv3WBVGYCnfV3IEevaLfg3iLWtUNrZDjVQcVfipCqsYalUh1L8LTf/pagY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.248478, 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 get_first/next_page func series and kmap_atomic to new helper, no functional change. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Alex Shi --- mm/zsmalloc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a3e2e596b4f3..83d48cffe96f 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -925,16 +925,16 @@ static void init_zspage(struct size_class *class, struct zspage *zspage) { unsigned int freeobj = 1; unsigned long off = 0; - struct page *page = get_first_page(zspage); + struct zpdesc *zpdesc = get_first_zpdesc(zspage); - while (page) { - struct page *next_page; + while (zpdesc) { + struct zpdesc *next_zpdesc; struct link_free *link; void *vaddr; - set_first_obj_offset(page, off); + set_first_obj_offset(zpdesc_page(zpdesc), off); - vaddr = kmap_local_page(page); + vaddr = kmap_local_zpdesc(zpdesc); link = (struct link_free *)vaddr + off / sizeof(*link); while ((off += class->size) < PAGE_SIZE) { @@ -947,8 +947,8 @@ static void init_zspage(struct size_class *class, struct zspage *zspage) * page, which must point to the first object on the next * page (if present) */ - next_page = get_next_page(page); - if (next_page) { + next_zpdesc = get_next_zpdesc(zpdesc); + if (next_zpdesc) { link->next = freeobj++ << OBJ_TAG_BITS; } else { /* @@ -958,7 +958,7 @@ static void init_zspage(struct size_class *class, struct zspage *zspage) link->next = -1UL << OBJ_TAG_BITS; } kunmap_local(vaddr); - page = next_page; + zpdesc = next_zpdesc; off %= PAGE_SIZE; }