From nobody Sat Feb 7 14:32:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E59B0762C1 for ; Tue, 6 Aug 2024 02:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722910750; cv=none; b=BAbBGqZRUtTmBbXYmC/Fc6iQ9gX+y0qrz+2bi4ZjLXTzjuVxrg05cs/2C1Kl2KqN6qV8/KyeIwvNK1n5qTDK5y6ZhiF2M2iF8D/O0KEaphAX4MyYAmRqUsrzIDG+EJfrPuj5efgw83s1truR1Y3Vkk+zEkO40WkU9Ux1/oEfwM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722910750; c=relaxed/simple; bh=SIgiyPCW8QCBZtqr5fnMzvbajnde7CasC3gp99UMX7E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=StnfxI8cPYVc7qR5dx7JMHZY3RBYU/p2sjBEA6jxgKG9Bp6pKYYb8q8EOTp8KChZr4kvY1cZizkGTfOGAB0U/EG2VgXp6C627pppOo8c9vCvgGqtVVjLLyVRytN+S8hATlQssj09X2DJlJe0iNS6GolQtExCBaJH52Iqv0IBwxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eogsWgAJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eogsWgAJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E4D5C4AF0C; Tue, 6 Aug 2024 02:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722910749; bh=SIgiyPCW8QCBZtqr5fnMzvbajnde7CasC3gp99UMX7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eogsWgAJOVMVgMm+88DiD7XkroE1wr8TVvpEQjp6NmnLl30eBFsFWj/nQJK+I8c5I jUhC6+ElxHccYMtnUAdfDvOCrIXJ1xMAi+HSzAgR5yAn1y686RgXFAQo4iYVVx44kJ dBNVnqwpiPqTyTKh3OA5LoUrYXaseNQYH3N0a+Z8E9/IdcZJ72fPC9/LMMjOC5NpMH h46X+x/17nvesgtbZ3mxjDf/f1XGF2Wp8TGFIPucQKhRAFPIUBJxVLCHLlEozMXN/2 yHKU2MvKQY37DOnJnxKAUQXYl65JxIApCyH3Cvfj9VuUr49mJFH14C+pH9E5/7j6Ly xUWeJVNSWL3aw== 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 v5 20/21] mm/zsmalloc: introduce zpdesc_clear_first() helper Date: Tue, 6 Aug 2024 10:23:07 +0800 Message-ID: <20240806022311.3924442-21-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240806022311.3924442-1-alexs@kernel.org> References: <20240806022143.3924396-1-alexs@kernel.org> <20240806022311.3924442-1-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alex Shi Like the zpdesc_set_first(), introduce zpdesc_clear_first() helper for ClearPagePrivate(), then clean up a 'struct page' usage in reset_zpdesc(). Signed-off-by: Alex Shi --- mm/zsmalloc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 0b318db894a8..e92451c6b69c 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -253,6 +253,11 @@ static inline void zpdesc_set_first(struct zpdesc *zpd= esc) SetPagePrivate(zpdesc_page(zpdesc)); } =20 +static inline void zpdesc_clear_first(struct zpdesc *zpdesc) +{ + ClearPagePrivate(zpdesc_page(zpdesc)); +} + static inline void zpdesc_inc_zone_page_state(struct zpdesc *zpdesc) { inc_zone_page_state(zpdesc_page(zpdesc), NR_ZSPAGES); @@ -824,10 +829,8 @@ static inline bool obj_allocated(struct zpdesc *zpdesc= , void *obj, =20 static void reset_zpdesc(struct zpdesc *zpdesc) { - struct page *page =3D zpdesc_page(zpdesc); - __zpdesc_clear_movable(zpdesc); - ClearPagePrivate(page); + zpdesc_clear_first(zpdesc); zpdesc->zspage =3D NULL; zpdesc->next =3D NULL; reset_first_obj_offset(zpdesc); --=20 2.43.0