Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1982568rdb; Wed, 31 Jan 2024 15:45:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9pn24t91LdEWJXWBBFX4zIvFVtnOfyfaqX0iPXxc088BcI43j/XP65/ECWYHc47sVXU2x X-Received: by 2002:a05:6358:d39c:b0:176:493f:ad4d with SMTP id mp28-20020a056358d39c00b00176493fad4dmr3276981rwb.10.1706744740965; Wed, 31 Jan 2024 15:45:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706744740; cv=pass; d=google.com; s=arc-20160816; b=yaHOPFzqHpp33PNsmtU29tL+iE9t0S3LrxxFHQopED+Fj01FtvtyeJk+tgloUl/y35 yQg49PdU+AoJ2I+56wGow/ya+BTqaO1YlsebCZ9pgDF3PyeWNAFDoBJT6BtEA0HUzjpJ X49HQzqcPpzF79wEdvIk3M/lWVXdWw64vQjkQOy0BUD3hnshBkOU8GBsfasDBgjDd5kO ABmKBY1AQPdsDiTUWHcebKWslnlV1f8gh89i7fcEiewf92MckNFGvbkeCMkIGgStLgwX KksUKoq+R3X4leQ1FItmyzCyrhQzDKZybMummuEwci23FdzyncAaxavhes/HUO7S9R9A /Fvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=BdhkAvN2zMAgv21EXTQPE0zKw/2sDB8RKNrBCMHc8lw=; fh=VTbL44CkiobmwCmr9DBzatJBuZfIy0zMHI03HoIcnDE=; b=iSrrUH4M7oGn1P5/oqEsPdykwlkgAjWAEXIkEQ1u9klI0xTfVZSCi5CMP6ePXPxq2f 1+plp+mO/DXo0HrZch/Adh281Hg3nVcONFiAd1UPkyPVoVST4mQ7lQp2MVbgJoO7ZzwM C8RgMzqdNeyh/RI5QB9WUpWw5SLIcX4DTpeMWiQJ/EFzXshpCAziX5CvOBs6UGRJbXQT 92wtyzdaFOdrjGvIw5KN7jmQKJqwCU3xd85zOcemOfgTDJujuEAaV6zKXGI5kj25+OYL T/kxilqyxq4rOucIKV3JLnP7kJfgErc4P1Luy7vG8G1yoQ0d5bHGRWjRFp71aSDK09fe XLMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l1DPav01; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-47372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCXMTrXJfWhmvRcRKe7mzt1mJmb8xKx+moMSQThbd3KCwNdpaA5iCRQg5xuvb2jPXGi0qJaKed9mmn898V7fi26TqwUL9UPmJ20FCZMHpg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i126-20020a639d84000000b005ce3cd4ed95si10994206pgd.94.2024.01.31.15.45.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:45:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l1DPav01; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-47372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8FA4A2862FF for ; Wed, 31 Jan 2024 23:36:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73B01405CF; Wed, 31 Jan 2024 23:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l1DPav01" Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2759C3A8FC for ; Wed, 31 Jan 2024 23:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706743473; cv=none; b=jX3wOJxdJyB0XbRLaKvYfVO9Tir+wRSlndxEE6WSdjD4skWRuyVNJOLxncoC9+ck+752rc5PgwhetKUHQPVk+aIkcORFZkgXTLo/qTNrwXw/FIJx7shu1aa/YKFTFYq/oZP6biyc5b+XMi1Lcxpf551+55p8EB8cjBa3DXEKdRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706743473; c=relaxed/simple; bh=0dUTagYMP3ifGj+3mqf45+Pb/VzGMHLkAj8F2m+W17I=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eNiZtO73K5WvbF73GKSo0qrqYR/+W3ThDcGviIEy63/xfSMRBHNqH3p+Oul0WTFW05iMTmSA0pxoNFDXVwXUCfN3XIXM49o8dxH0ZSYdKn87Z2d0rdDAhZNGaaP2avDgXUBD+UJbEKardO6+l6c8qYbvDdf9TeAI5HqerySdKvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l1DPav01; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7baa8097064so15726439f.3 for ; Wed, 31 Jan 2024 15:24:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706743471; x=1707348271; darn=vger.kernel.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=BdhkAvN2zMAgv21EXTQPE0zKw/2sDB8RKNrBCMHc8lw=; b=l1DPav017H0ytwBGYoPvw/E4AMeyDBBmcWCIGrbvaQ3B4BXMxYXoaYDCABMVmdTK8A eZXV+HjKGyE+FMDsLhniXKCkqptR16uk8L3VliEdluXPVmGYMcvKoF/zRQOQa75TUmKc fiBKoQPsxWfH9IEeKEURTJEP11591cFe4qjuEw9rioxoqcDHPAHAqPmtgR+zvfa5IEAg CIWRu1mL0RuJQJO10l1oxT344UOoR4o5cwx4QVD1skUDGiJ5kmTej7iEtNSPof0koGVF LYVQm6rvt+Zy+2ylUPHpLwOB0QFjqRescmNYerlBu/Lvkxvb5hxAPlM5+LkfgYwZuQwh vSwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706743471; x=1707348271; 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=BdhkAvN2zMAgv21EXTQPE0zKw/2sDB8RKNrBCMHc8lw=; b=Ji4S0epf7IQEPC6OzU0oHPmpha8JxIaZRdYNrswH3+yh+nO73meOA592ANJKfs+L6S K8j74g/YphtrMk9RbLGdZj6zv8IcH+hkcXs0X1RgdzQmGIg7uRLcAuZjTOvZT6xWsm+2 BYTXQ8edqOY6TjK+2T6syu2uQYVYIcORyJkZNpSJuDvny12z7RgA30MXFz/cyvI2SlgF raEiK9fTUhuhZYPOXkAZI+0OpRFJxntCQK3uz+ZhLiZD+N0uHVk/e9qUg+YFSrfxRYkp 2j2qlOAc2KmhMnUrwD279FpR3BRArAMf3oCop1cBmBRZMVrtXYaQB4R3DT5kgv05rRUB h8IA== X-Gm-Message-State: AOJu0Ywe0VkZOASzQbtA0o12nygTc7bZEs2+3GmLwFz9mwqU5F17MW+Y F0LNjbrVSPp9VXmbtKvjSgvsUgLRAsq/6j/ea+qKGy7K7D0AHIfNMKQA5e8YzxU2dJl5OIPggSQ 9NrW4p7R1aD+3SaclcbQ0UIQxmOA= X-Received: by 2002:a6b:f218:0:b0:7bf:ec4f:3c3d with SMTP id q24-20020a6bf218000000b007bfec4f3c3dmr3450799ioh.14.1706743471151; Wed, 31 Jan 2024 15:24:31 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130014208.565554-1-hannes@cmpxchg.org> <20240130014208.565554-17-hannes@cmpxchg.org> In-Reply-To: <20240130014208.565554-17-hannes@cmpxchg.org> From: Nhat Pham Date: Wed, 31 Jan 2024 15:24:20 -0800 Message-ID: Subject: Re: [PATCH 16/20] mm: zswap: function ordering: move entry section out of tree section To: Johannes Weiner Cc: Andrew Morton , Yosry Ahmed , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 29, 2024 at 5:42=E2=80=AFPM Johannes Weiner wrote: > > The higher-level entry operations modify the tree, so move the entry > API after the tree section. > > Signed-off-by: Johannes Weiner Reviewed-by: Nhat Pham > --- > mm/zswap.c | 42 +++++++++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index 756d4d575efe..80adc2f7d1a2 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -848,27 +848,6 @@ void zswap_memcg_offline_cleanup(struct mem_cgroup *= memcg) > spin_unlock(&zswap_pools_lock); > } > > -/********************************* > -* zswap entry functions > -**********************************/ > -static struct kmem_cache *zswap_entry_cache; > - > -static struct zswap_entry *zswap_entry_cache_alloc(gfp_t gfp, int nid) > -{ > - struct zswap_entry *entry; > - entry =3D kmem_cache_alloc_node(zswap_entry_cache, gfp, nid); > - if (!entry) > - return NULL; > - entry->refcount =3D 1; > - RB_CLEAR_NODE(&entry->rbnode); > - return entry; > -} > - > -static void zswap_entry_cache_free(struct zswap_entry *entry) > -{ > - kmem_cache_free(zswap_entry_cache, entry); > -} > - > /********************************* > * rbtree functions > **********************************/ > @@ -930,6 +909,27 @@ static bool zswap_rb_erase(struct rb_root *root, str= uct zswap_entry *entry) > return false; > } > > +/********************************* > +* zswap entry functions > +**********************************/ > +static struct kmem_cache *zswap_entry_cache; > + > +static struct zswap_entry *zswap_entry_cache_alloc(gfp_t gfp, int nid) > +{ > + struct zswap_entry *entry; > + entry =3D kmem_cache_alloc_node(zswap_entry_cache, gfp, nid); > + if (!entry) > + return NULL; > + entry->refcount =3D 1; > + RB_CLEAR_NODE(&entry->rbnode); > + return entry; > +} > + > +static void zswap_entry_cache_free(struct zswap_entry *entry) > +{ > + kmem_cache_free(zswap_entry_cache, entry); > +} > + > static struct zpool *zswap_find_zpool(struct zswap_entry *entry) > { > int i =3D 0; > -- > 2.43.0 >