From mboxrd@z Thu Jan 1 00:00:00 1970 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 5672BE7717D for ; Thu, 12 Dec 2024 00:12:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD7626B00AB; Wed, 11 Dec 2024 19:12:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C84716B00AC; Wed, 11 Dec 2024 19:12:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD7106B00AD; Wed, 11 Dec 2024 19:12:10 -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 5444C6B00AB for ; Wed, 11 Dec 2024 19:12:10 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BC97544445 for ; Thu, 12 Dec 2024 00:12:09 +0000 (UTC) X-FDA: 82884379074.05.C8131B2 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by imf17.hostedemail.com (Postfix) with ESMTP id C9BC440009 for ; Thu, 12 Dec 2024 00:11:49 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k826nEuZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733962316; a=rsa-sha256; cv=none; b=OqriF5d6esNTcdK+DQ5N9eaAeVw6OgYf7VCn76RQUiaoCDsiY4pB+WegJSpkfr5jRwPg+W SZeCs+Q3vFXxlJ5P10MHwSlHSrHyhMRwOpeLCcwbtaBd9vqwpXPyzP86fewQ5zdNZVrUr6 BJc6CeEi9d7gcbI2cuCEuDPmWTjQo/w= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k826nEuZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.44 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=1733962316; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9z2q/uUL3Q/JuPCGlakeR/obpIHkBDfu4Oi67BAWd38=; b=8h2Qf8ajHA0oWeJtc3bh+p+SXks/CKD+EVwTFFwbogRQxcP4fx8BkaXHapinFDLIYMp02p 4WF6B1UIG3ypIyNzGd7nYN4EryuA9OivFMEm29kLNXZcp/P6vs6oIam+GJI/dV5dlFT8TF jwS0FSwrcRcUx5SI8gtKRvoFlEnE8Rc= Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-540218726d5so23041e87.2 for ; Wed, 11 Dec 2024 16:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733962326; x=1734567126; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9z2q/uUL3Q/JuPCGlakeR/obpIHkBDfu4Oi67BAWd38=; b=k826nEuZndWlzDaeCm+FG+bcDfyOI/NUvsHXSvHtMHhctvWQZQwbDqsAZQIbd458mX R8X9yzSjqUcIky8dfxkuVhUEK4MwdHVN2KHqJSDIsSpWjxAaN91fqXMCHt7604PwN54O XbaDxWmPFjkBnAQGpdEExQ+H6glyrWtHTva3AqFiz/oYva4LSHuVknigNBbLmyuaFkrX zXN4lPJ9AiOU73ldfTfnHfs2y4TmGGbH3cgaZsGRFRLV1N5dTdhie8PbJnh/sr0NC4PC JMSQ2y2u8dxZjpMumuXe9LuCwXA+IFFgiiwYsir9Mpoogu5HWuMPFPR3zqSs7kBSYGh5 T6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733962326; x=1734567126; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9z2q/uUL3Q/JuPCGlakeR/obpIHkBDfu4Oi67BAWd38=; b=D2JGPa9zny/O2LWY0q2JJqGT3WuL0E+1T+WOuj1sN6qoLAtlEDwauW2CFOa4LagztZ WFBKxnBc/1cCMl0AbJZUMjoG0DUsXThUz6p3bloANrHyaIZryKIYFJ9BVjcDsCF7TESj 9WpU/WmuDkE9ulYGCDORX5z61JkWa3aDmkSWHYnlvwnVhWMqcRxPws6R/uf9N8XI3wxZ 5V8HoQHlgB6IrhKidk6IBuSTY6nM9q/rQYmB8sSUpVv9wy3oAwpS234JCNmX0+l4hnzy Chk775Bsk368buyrsTQ52esa5W3wcsmB+HCp3NmNOkqlwQUwm5XEg3tQb56WP+8xC7Ju CxlQ== X-Forwarded-Encrypted: i=1; AJvYcCUHj9+DQA7/o/rmf9pe831Q2OLPRX2LYVZSJ4XwEeq55vTQYRoZOUtfN7ELmwyiiLGAxbpP24jvSQ==@kvack.org X-Gm-Message-State: AOJu0YzskG1PlGVzNJ0v32cka6muvoPPqpTrKe6BBxmSI4tyt1pjA2CK b7YBoNxSHUQt3ZV60ezg1tPu7MXPbzK7X91XrDA6xVYPnjPwDsB3gCvtQo9yhon2OvAG9Gi0oM6 TW5uL4XolzUb+k0VjDoLZ2rzcYMA= X-Gm-Gg: ASbGncscR9FD2fyOWQhwviGJe483ZZK1LFsutZ/8Eyzgr0//A0MqwOHcIFArYJwVFbg qCpDnal7jrb/hXXY48GkjWuC2B0ijM5ubIMGB9d4PrqIO9PIpS9CJKoPx16ttDFU9AW2f X-Google-Smtp-Source: AGHT+IE9wGnD/gWDLXGgHmFC4ZGvioy1sx599tY7Vq7lBXzSWzxW0J2Qd/N58LyJLIqDiRhuGJ9uNRwD7SRb/dHq4oE= X-Received: by 2002:a05:6512:3c9d:b0:53e:fa8b:822e with SMTP id 2adb3069b0e04-5402a6020e6mr1542510e87.37.1733962325657; Wed, 11 Dec 2024 16:12:05 -0800 (PST) MIME-Version: 1.0 References: <20241205175000.3187069-1-willy@infradead.org> <20241205175000.3187069-22-willy@infradead.org> In-Reply-To: From: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Thu, 12 Dec 2024 09:11:53 +0900 Message-ID: Subject: Re: [PATCH v8 21/21] mm/zsmalloc: update comments for page->zpdesc changes To: Matthew Wilcox Cc: Minchan Kim , Sergey Senozhatsky , Alex Shi , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C9BC440009 X-Stat-Signature: u747nnp8acrj73i7sdfmkcmj11gwnhsr X-HE-Tag: 1733962309-19799 X-HE-Meta: U2FsdGVkX1+LpnhNysuhVv8mf7M87eLaYHic0Il++rY3U4kXLXSyL9IJBSZzPbZnBvkwxqztvD4wr0AbA/j4ojZWL8SdWBcGUVmqm+5VQflXbQBEwHgIdDtVoqc3SitiRfp7X38dZFbP6FeiTdmm3kIqMsGROiJycC5nZnp09SNYBKIsZ0LU6/mEmKNTt0qFs9C2/xUPnAz8ei3GaG+l0BThActTuCRsFnXitK9wGtVIJ3SrCPyiTMllbCpZc1dsXoQFh+RfkqtAWKF4KcpqXxAUO3oxF5T3WCLE6vT1+4mfEEgmlgMYMyBn2inhtvJSc2uQRZHBwo+RHz1otb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D2WHCdk/D5fs2gcOj3/bga8mUmwlMn3f9Bj X-Bogosity: Ham, tests=bogofilter, spamicity=0.336747, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Dec 11, 2024 at 1:37=E2=80=AFPM Matthew Wilcox wrote: > > On Wed, Dec 11, 2024 at 12:46:43AM +0900, Hyeonggon Yoo wrote: > > Talking about updating comments and code by replacing 'page' with 'zpde= sc', > > I'm not sure if it makes sense to replace all instances of 'page' with = 'zpdesc'. > > A zpdesc is a descriptor, not a page that contains data (at least that'= s > > what I have been thinking while writing the initial patch series). > > Agreed. > > > In that context I'm still not sure if saying "a sub-zpdesc of a zspage"= , "lock zpdesc", > > or "migrate zpdesc" makes sense because replacing 'page descriptor (aka= . struct page)' with > > 'zpool descriptor (aka. zpdesc)' doesn't mean zsmalloc is throwing away= the conecept of pages. > > sub-zpdesc is a silly thing to say. subpage is equally silly. If it's > a page, call it a page. Agreed. > However, locking the zpdesc does make sense -- we're locking the > descriptor. That makes sense. > > > /* > > > * Following is how we use various fields and flags of underlying > > > - * struct page(s) to form a zspage. > > > + * struct zpdesc(page) to form a zspage. > > > * > > > - * Usage of struct page fields: > > > - * page->private: points to zspage > > > - * page->index: links together all component pages of a zspage > > > + * Usage of struct zpdesc fields: > > > + * zpdesc->zspage: points to zspage > > > + * zpdesc->next: links together all component zpdescs of a zspage > > > * For the huge page, this is always 0, so we use this field > > > * to store handle. > > > - * page->page_type: PGTY_zsmalloc, lower 24 bits locate the first ob= ject > > > - * offset in a subpage of a zspage > > > - * > > > - * Usage of struct page flags: > > > - * PG_private: identifies the first component page > > > - * PG_owner_priv_1: identifies the huge component page > > > + * zpdesc->first_obj_offset: PGTY_zsmalloc, lower 24 bits locate the= first > > > + * object offset in a subpage of a zspage > > > * > > > + * Usage of struct zpdesc(page) flags: > > > + * PG_private: identifies the first component zpdesc > > > + * PG_lock: lock all component zpdescs for a zspage free, serialize = with > > > */ > > > > I think this comment is unnecessary, as it's already documented in mm/z= pdesc.h. > > It can be removed in patch 01. > > Agreed. I did think about doing that, so if you want to do it too, > that's two votes for doing it. Will do in v9. > > > @@ -1351,7 +1353,7 @@ static unsigned long obj_malloc(struct zs_pool = *pool, > > > /* record handle in the header of allocated chunk */ > > > link->handle =3D handle | OBJ_ALLOCATED_TAG; > > > else > > > - /* record handle to page->index */ > > > + /* record handle to zpdesc->handle */ > > > zspage->first_zpdesc->handle =3D handle | OBJ_ALLOCATED_T= AG; > > > > the name of the field is already 'handle', > > so we don't need a comment to explain it. > > Agreed. > > Do you want to take on producing v9 or do you want me to fold in your > suggestions and send it? I will send v9 with my feedback adjusted this weekend. Thank you for rebasing and pushing this forward. Best, Hyeonggon