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 C6C72E77180 for ; Fri, 13 Dec 2024 02:25:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D8006B0083; Thu, 12 Dec 2024 21:25:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55F9A6B0085; Thu, 12 Dec 2024 21:25:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D9346B0088; Thu, 12 Dec 2024 21:25:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1C2766B0083 for ; Thu, 12 Dec 2024 21:25:59 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 87DE3160A36 for ; Fri, 13 Dec 2024 02:25:58 +0000 (UTC) X-FDA: 82888345092.11.02364E0 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf01.hostedemail.com (Postfix) with ESMTP id A13AA4000C for ; Fri, 13 Dec 2024 02:25:37 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AfQX3xnf; spf=pass (imf01.hostedemail.com: domain of seakeel@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=seakeel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734056733; a=rsa-sha256; cv=none; b=4EsiImKr4O4gonRlRKtxZWZoWM8n6Mh/++QnqcyzJafbINzbsWWOngTVZsl1mZj46YQCU9 YS+HSxoDc69hvwPCRgB2i6YWU0uAUdUQ9S3YtlPWgKalcj95n79GDTJ0w/U/UBhAZBwhfh 8s3MbYTnuiIYl3+kyzmYWWuXhHTYnlk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AfQX3xnf; spf=pass (imf01.hostedemail.com: domain of seakeel@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=seakeel@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=1734056733; 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=B8H9nrf+4IfbLRk0I63GJXs1g6TRqOonfuUgJvMAMVE=; b=B/8u0airIHi2odfU8BJ4pmQGHpxkyUXHodkghwfbD7Q5BE5nZxoL+dTvXpIhpc4MSkFdxZ awRUiwOqnoU6iOMtR6QEwZRavHW2wL6bNsfBwW/B7kfXdOr6uRBTajkc5uMQYrXJPW53VT LhaNOiInNRwPjGlXiDPuqACiDkm82dY= Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d3f57582a2so4620822a12.1 for ; Thu, 12 Dec 2024 18:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734056755; x=1734661555; 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=B8H9nrf+4IfbLRk0I63GJXs1g6TRqOonfuUgJvMAMVE=; b=AfQX3xnf6JgXNY66sjBVJmhgXOIuZbaVgCej3cMCVr2vVkbASSnDfwS4+wrQTQnVI+ 322Eizr3cNEXXlcyzwdC+uJ41AByoJFA21DtFHng/KLJboiMeqUzhgJ103PipweLL44M oKubqau1+CA/ZIjO0UFhde70X+BTALDyDyaC1nE8ysmLT9mI/KaIeSi9YcP4PBZLkmtF tvIuWGysPs1bwHm9DyBZ94dHvNi0HyYXx7qZQVp8S23aeFlaKPRcNt++x2mJpN+A+kw1 hyEEyVatZrQXykIli53Zyc+5AHzZS0ZHzvibbN9kU3rYe5TL1DMxbkPJWnB4A7pT4gx9 K0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734056755; x=1734661555; 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=B8H9nrf+4IfbLRk0I63GJXs1g6TRqOonfuUgJvMAMVE=; b=IcdonfPfu00IpQ5pUhU54jVn0sLEhQWX0fzHkMCpIhY7hJG185TpuNeocjTCsKR3ot aC0rrm6oTmen5Zoy1hPzazJKYwgrM00XXDLm9CXwOaZj+lqYWrCafdnsBmKORV56Q1h4 UtlF9Lq4drBSY0SM8FuBHDk1ExUhqNUBH9tbNepvpKqNd+hCnxb9Nz9Xjw1yg3FN5QGY iZYS2ZIS+2SmJSewHMvYAridzZeor07ATgAL4cjS5xYJLAOOxbVrfI9Ui763RI7uJM9Y JZdzG9qGC6VBgiyF1wq3q7Raw0FNWDRRK64kxM3dYsEz4h69RYjBB9YjEtfOSAXD8oOm eXAg== X-Forwarded-Encrypted: i=1; AJvYcCXSMblBABagC7x4WpxCi+FPhLItg2trpk7cqcSfVC6463ZQJfRJXct4nt4sW/l7f41f3AM+H7HCwA==@kvack.org X-Gm-Message-State: AOJu0YxKc0NaGQhfszRZUJAZvKE7oW1kbUgdEJqxcgVPGQYkwz0ThQV6 /f+9hF5zs2rUA7tXLjS54vDQBA3gjosUYrgAUJL522yVEmExLPMOSRwSTg17YehOo6B6q9TNSDI +UAEU8PEiRe2BtW6QJ9MMkhxnJvc= X-Gm-Gg: ASbGncv6XzKGcWMdat2j7MYnh+saVoamQA0/bsMo0P/hNrCU6j/TuYJG3SyBudeJ7gZ /7h/GenQ3laztykiSPUIjaUaGRxUTaqPV14agjQ== X-Google-Smtp-Source: AGHT+IH3Glv+NZ9XWl6/g7aNsYn78yU0JyiZ/tQdO0xrSr/ib+qn400d6UkGcM41UuBO37kbWIrbi319uR3D/e7vWUU= X-Received: by 2002:a17:906:3298:b0:aa6:98f8:36f5 with SMTP id a640c23a62f3a-aab7b0e9c6amr68029866b.2.1734056754812; Thu, 12 Dec 2024 18:25:54 -0800 (PST) MIME-Version: 1.0 References: <20241205175000.3187069-1-willy@infradead.org> <20241205175000.3187069-22-willy@infradead.org> In-Reply-To: From: Alex Shi Date: Fri, 13 Dec 2024 10:25:18 +0800 Message-ID: Subject: Re: [PATCH v8 21/21] mm/zsmalloc: update comments for page->zpdesc changes To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Matthew Wilcox , Minchan Kim , Sergey Senozhatsky , Alex Shi , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: A13AA4000C X-Stat-Signature: dn3w6p3r9d7cn1ceqbhmy5yekp5ejkyk X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734056737-458410 X-HE-Meta: U2FsdGVkX1+RvvHxarqHsSqyJIRKoLaEGxvbKnB+tfB+yUAIvrxEqR94RDvR+U0SzEZn+A6lXO4Gtmsd3Q47FIL7fpmWVR2lil3sqopS385AEKnzalCYr1pk8C8Gkjk6Q5L+YLVI29o8ydeRse4oEj/TfpKu01itomTwuXj8hlB9dq2afRdZ5gi/K9YhB/qoeeUE4lox2hpPAenneDNCM1RK8EEayBTBnAJHZm4hds8ytsIhrIgi90Szd74QRgQrDj/MQ2qL/LTWL+c99gDroCEiGiaURNPwcnl9ArYlln9tRINBfu0FaTZqKTDCJBwssNspjD49k+Wlgn1iGla5cqsG58mW8y4GacQI5vJFvOE0R6FmFUn2C524C2DRLx6zhR5eXZ8o+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tests=bogofilter, spamicity=0.083564, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hyeonggon Yoo <42.hyeyoo@gmail.com> =E4=BA=8E2024=E5=B9=B412=E6=9C=8812=E6= =97=A5=E5=91=A8=E5=9B=9B 08:12=E5=86=99=E9=81=93=EF=BC=9A > > 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 'zp= desc', > > > I'm not sure if it makes sense to replace all instances of 'page' wit= h 'zpdesc'. > > > A zpdesc is a descriptor, not a page that contains data (at least tha= t'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 zspag= e", "lock zpdesc", > > > or "migrate zpdesc" makes sense because replacing 'page descriptor (a= ka. struct page)' with > > > 'zpool descriptor (aka. zpdesc)' doesn't mean zsmalloc is throwing aw= ay 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 fie= ld > > > > * to store handle. > > > > - * page->page_type: PGTY_zsmalloc, lower 24 bits locate the first = object > > > > - * 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 t= he 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, serializ= e with > > > > */ > > > > > > I think this comment is unnecessary, as it's already documented in mm= /zpdesc.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_poo= l *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= _TAG; > > > > > > 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. Very glad to see it is pushed forward. I am changing to a new career recently, so sorry for not putting some effort into it. Thanks a lot for you guys! > > Best, > Hyeonggon