From patchwork Mon Jul 29 11:25:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13744745 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 CF35AC3DA4A for ; Mon, 29 Jul 2024 11:21:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAD9E6B00BD; Mon, 29 Jul 2024 07:21:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5D1B6B00BE; Mon, 29 Jul 2024 07:21:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B62A76B00BF; Mon, 29 Jul 2024 07:21:32 -0400 (EDT) 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 8B4C66B00BD for ; Mon, 29 Jul 2024 07:21:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3F7D0802C6 for ; Mon, 29 Jul 2024 11:21:32 +0000 (UTC) X-FDA: 82392549624.13.75A16DA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 9727C16000B for ; Mon, 29 Jul 2024 11:21:30 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hRs0YtQX; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722252038; 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=8/lHwzwwUkHEYMClxl5C8LP0fLL3XtkQXhSCyjQULWk=; b=X2/rQW8/DpfRC2Jc//0GeiJTvpLeGpH0/aGg8+IrVFeLn0e1yVIVp4n2tMUxkkE5+pix1W Bo92Ng97nTJx3dr0AkD2XyOdXOAqGNzMrX+d6LFTHKQwGlPDHHA4pwRewC9/yPEo4QKdVS fYiVxM/Tx3FlRSxi7S17boTmXEI0in4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722252038; a=rsa-sha256; cv=none; b=PbfSdhrfHiIxHgYLNFEdO41ZruyMnS1YkHy4/yEBLkeY5giuhftRseOXjFPFqO8rB6n6xj XGRCW1FSm7amfG9WsI2ejWsYXgIXQ0JM7qtLx1VT5UCI666xCpfiVt0fVYKQDoj3PpzMON kWNf3oyNz8NdMcudDPclcH90ePqlP0c= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hRs0YtQX; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E44D56177D; Mon, 29 Jul 2024 11:21:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8204C32786; Mon, 29 Jul 2024 11:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722252089; bh=rElfU0d71iABwZ67rvpmRaqaEhOUs/Njjel6X7x+ZZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hRs0YtQX+izREwBhLyXvqNE4b9sY2v23cdCN/KVwRcfz69oPiD+Hvnh90SwhTsaPb Vkx9r2ZgMQTy4rmd0MnKCimmI3w9vx/KaFmcPpT3SCdLMXKPYzhSEKbXTYzzNr3oN7 m26rXcx/pzAXE1R5k5eAqJYKMvinugxhBLA8twMfBgA+zJMoWYPl02pDo+cWmUbHLa Dm5UOuCX5Ae3mcSJ3o7Ckxn/IDqSbGnvEiu5bcPkEHVnYDBb3x2T6p1MDJsrdwE0E3 yqlmrYcH1BamgQHFciiWbXWkrO8PfJIgvAik/Cpka48aj+BCo5XT+UZrbc0mlt8Fu+ Okqo2hQrbz3mQ== From: alexs@kernel.org To: Vitaly Wool , Miaohe Lin , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, minchan@kernel.org, willy@infradead.org, senozhatsky@chromium.org, david@redhat.com, 42.hyeyoo@gmail.com, Yosry Ahmed , nphamcs@gmail.com Cc: Alex Shi Subject: [PATCH v4 22/22] mm/zsmalloc: update comments for page->zpdesc changes Date: Mon, 29 Jul 2024 19:25:34 +0800 Message-ID: <20240729112534.3416707-23-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240729112534.3416707-1-alexs@kernel.org> References: <20240729112534.3416707-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 9727C16000B X-Stat-Signature: o4skemp4be9oh8w3rcpjrk9mtqmj6iuf X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1722252090-569858 X-HE-Meta: U2FsdGVkX1/D4pYSSAFqeNksPHbnOSqgMp1joyNWsoXQbfNh5WttHnXuU40tFNRErMlvZX/Bg9GEzt0Z4rZyE6jwxu2xG7CPAPBCtA2lamwxbL7UQ6b4D8KfUgOcezFHEu2HNWQ48M6JgbJaIgmUhWZjXMN25Z6pbCD8F4aHsUfIJMGWRDuwW/Vc5FspALcnGXC1PPCvPo3EqVRRoiUwOCYtIF2hlhZf8K1tK/tWRbjOqZmRZptN3DRkezcF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 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Alex Shi Signed-off-by: Alex Shi Signed-off-by: Alex Shi --- mm/zsmalloc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 64e523ae71f8..50ce4a3b8279 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -967,7 +967,7 @@ static void init_zspage(struct size_class *class, struct zspage *zspage) set_freeobj(zspage, 0); } -static void create_page_chain(struct size_class *class, struct zspage *zspage, +static void create_zpdesc_chain(struct size_class *class, struct zspage *zspage, struct zpdesc *zpdescs[]) { int i; @@ -976,9 +976,9 @@ static void create_page_chain(struct size_class *class, struct zspage *zspage, int nr_zpdescs = class->pages_per_zspage; /* - * Allocate individual pages and link them together as: - * 1. all pages are linked together using zpdesc->next - * 2. each sub-page point to zspage using zpdesc->zspage + * Allocate individual zpdescs and link them together as: + * 1. all zpdescs are linked together using zpdesc->next + * 2. each sub-zpdesc point to zspage using zpdesc->zspage * * we set PG_private to identify the first zpdesc (i.e. no other zpdesc * has this flag set). @@ -1036,7 +1036,7 @@ static struct zspage *alloc_zspage(struct zs_pool *pool, zpdescs[i] = zpdesc; } - create_page_chain(class, zspage, zpdescs); + create_zpdesc_chain(class, zspage, zpdescs); init_zspage(class, zspage); zspage->pool = pool; zspage->class = class->index; @@ -1363,7 +1363,7 @@ static unsigned long obj_malloc(struct zs_pool *pool, /* record handle in the header of allocated chunk */ link->handle = handle | OBJ_ALLOCATED_TAG; else - /* record handle to page->index */ + /* record handle to zpdesc->handle */ zspage->first_zpdesc->handle = handle | OBJ_ALLOCATED_TAG; kunmap_atomic(vaddr); @@ -1783,7 +1783,7 @@ static void replace_sub_page(struct size_class *class, struct zspage *zspage, idx++; } while ((zpdesc = get_next_zpdesc(zpdesc)) != NULL); - create_page_chain(class, zspage, zpdescs); + create_zpdesc_chain(class, zspage, zpdescs); first_obj_offset = get_first_obj_offset(oldzpdesc); set_first_obj_offset(newzpdesc, first_obj_offset); if (unlikely(ZsHugePage(zspage)))