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 1B8C9C433FE for ; Fri, 18 Nov 2022 20:04:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A76136B0071; Fri, 18 Nov 2022 15:04:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A26A16B0072; Fri, 18 Nov 2022 15:04:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EED56B0074; Fri, 18 Nov 2022 15:04:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7FFBE6B0071 for ; Fri, 18 Nov 2022 15:04:42 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1486CABB30 for ; Fri, 18 Nov 2022 20:04:42 +0000 (UTC) X-FDA: 80147640804.23.63F5314 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf27.hostedemail.com (Postfix) with ESMTP id 7B38A4000F for ; Fri, 18 Nov 2022 20:04:41 +0000 (UTC) Received: by mail-qv1-f52.google.com with SMTP id e15so4078033qvo.4 for ; Fri, 18 Nov 2022 12:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SnH+UGx6+sixESVz7YWSOh6Sim/QTDifgTL6tzstjgA=; b=DRWPND7gokcVicYVOXrukH04arSMoUahVZMMvUuh/RZt1CvnZFSwMWfFrl1QuagkEO 4IjO4oIV1BjTQCV0spRV/0O4t4cHZRBC4h6d0t77WIEXWlzt/p6E7fmbLczkx83ORg+3 9dx+ArTvBbihStU79hog4sLh8bQ5/lblrBt+E8qj9ExOS8QaFauZF7UeflI4msz+RuTE Z7DGKxt3qghkgGm+EznYjml/czTKqLXhCS0pnS/7dNxVWEYAoXqjglKdSOoY4RME3egL NbO6T82tPvXEWS+KmDaKV7mpwcfeer+q6zPQNk6ss8XwL9UaRnIdC/nkeyJA7zB8/NbP 85fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SnH+UGx6+sixESVz7YWSOh6Sim/QTDifgTL6tzstjgA=; b=L4ahCKJJxbo3p24jMyxRllkOYeKChhNTeQ9Gh1XDPxDXTzq77vKpoBy1lm+L2m1b65 s0pSS1ZAheMJn5HUcbOoNXS98CTcHrNbangriIetPSKnx7zklCB+Mb96pBHZmvtDsx2c BTTyEHmVJDdDEZF/qQaQmzxqCL7TO3cZ51gR/4yfkc2FNx4a+ad4mJ/aEiSp+zc92Ca7 1pWvVgedETRKSiOVunBkRjtG73KtvAAsQjwK6KP/ze7vyMYbsxaQQrAnrvlzAF/UNLAd 5pE9ER8OE9Wr4k6geqH9FlkEUFeY+JCWo4DwnycmWJaI5STHqiWi1NG7/G8pyEDPjGC8 a2ag== X-Gm-Message-State: ANoB5plhjQ4vNYW96n92OGAmCDbO+7FuYpl7fsxH51wNp2EiCUFbxK2W tfTDpd+1OaT4OoKby1WrvoNDOA== X-Google-Smtp-Source: AA0mqf53XtBWr5U1zPbvI6iymbL1muAxR7LyTGqpMGH2buD3DhgLQS922JiRBZu4ZwalPNGfmukrLQ== X-Received: by 2002:a05:6214:162e:b0:4c6:57f1:3514 with SMTP id e14-20020a056214162e00b004c657f13514mr8140454qvw.87.1668801880681; Fri, 18 Nov 2022 12:04:40 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:bc4]) by smtp.gmail.com with ESMTPSA id d7-20020ac86147000000b003a5c60686b0sm2564105qtm.22.2022.11.18.12.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 12:04:40 -0800 (PST) Date: Fri, 18 Nov 2022 15:05:04 -0500 From: Johannes Weiner To: Minchan Kim Cc: Nhat Pham , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH v5 4/6] zsmalloc: Add a LRU to zs_pool to keep track of zspages in LRU order Message-ID: References: <20221118182407.82548-1-nphamcs@gmail.com> <20221118182407.82548-5-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668801881; a=rsa-sha256; cv=none; b=7y8pv2MX/fmC/Om5OIFh0aUIl1RB7pMg6QEtBlSkPe/1Xgp3nbH14TEBwBVHcd2sVb+cRD uXmz3v2ZqphYX7M1UjwFrBBj7zpIWuNoHTUbi7hCf2Lx6D1B9nTlMfMSAz5D2J3IXWS436 YuzSFMeqChtaN9SXMk9M/VCkJmKDtnA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=DRWPND7g; spf=pass (imf27.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668801881; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SnH+UGx6+sixESVz7YWSOh6Sim/QTDifgTL6tzstjgA=; b=jgHKILJbnLtLwqdyhoUIwm2bLgdCEpwWlXKAtdReekN3C6HVsZtfow3CSgm3cNcDv8VlkN 5ZSHOrywCaHgu8UH2H0pSxufvxRGvWz2SBzH+tvjRKUjx+Pc1IjUytuUNildhrVMpYcnos 4brlr4ao76a2tf23HnWXuIZc7Wf0g00= X-Stat-Signature: cqq6esjgj7t3j48nyiidet6g4r9ktce9 X-Rspamd-Queue-Id: 7B38A4000F Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=DRWPND7g; spf=pass (imf27.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1668801881-973424 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 18, 2022 at 11:32:01AM -0800, Minchan Kim wrote: > On Fri, Nov 18, 2022 at 10:24:05AM -0800, Nhat Pham wrote: > > @@ -1444,6 +1473,11 @@ unsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp) > > > > /* We completely set up zspage so mark them as movable */ > > SetZsPageMovable(pool, zspage); > > +out: > > +#ifdef CONFIG_ZPOOL > > + /* Move the zspage to front of pool's LRU */ > > + move_to_front(pool, zspage); > > +#endif > > spin_unlock(&pool->lock); > > Please move the move_to_front into zs_map_object with ZS_MM_WO with > comment with "why we are doing only for WO case". I replied to the other thread, but I disagree with this request. The WO exception would be as zswap-specific as is the rotate-on-alloc. It doesn't make the resulting zsmalloc code any cleaner or more generic, just weird in a slightly different way. On the other hand, it makes zsmalloc deviate from the other backends and introduces new callchains that invalidate thousands of machine hours of production testing of this code.