Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp479696rdb; Thu, 18 Jan 2024 09:03:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhIy/hiASrrpgsHxH14NPp1lP5/51iYSTDyywQ3BlOEV++lSnhr5WB1EhPnS8cHAGWZ+fO X-Received: by 2002:a05:6214:29e7:b0:681:796d:762a with SMTP id jv7-20020a05621429e700b00681796d762amr1145106qvb.18.1705597429896; Thu, 18 Jan 2024 09:03:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705597429; cv=pass; d=google.com; s=arc-20160816; b=AoOKV/oKBZQmfBbjQfRLTKBbaaQ9e9PN2nPG1mORBhIcy2oVpFQFJDzpEKmf3tbdWA klkYpW0eIVVVZOQk3lZLxrG7LCnNrHyQhidF6tTVJpo/NVNBIJYp85cMaUqO1geCsHIu LMGzmeRfbWrFtIRAev8ZgzBzuYoxbDNnnfqVAc3mxCqjutV4H2MDqBVVCRRhwlsThJ++ zF1D0ugmtduKr29s20yxoHulhnVurXoBlmOFX3VCUjRvF22LJrNl0/6w2GG5TLiw84uu UPqDu4RpAzqa821ObxrOqbqZGcpX1x5gjAdTjL3iMm0xSY5fqFn36PlhsolDDkcMNALN fmSw== 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=I307JXW0PD3nSS/XpS3TGtlMDXTLZF0yfATueCQN9yk=; fh=WhPuj+kNg30I/nURNpnn9s6W2Cf+t8LtJAh7aAynHVM=; b=aDk+dRg2EKJuoXU16A/XYRgENAxnhjteGpZ7NobgjldFutiC79rE6+z5fL+owH4Ddu 4WDugKTbg97v0b9Ukqn2FMu1EkaOGlIYNFCuHEv//saEE/9sELP2U1271UZGhGOSfVsI nzwW2OEVL9Q4zZB+E5QvyCq4JA2UgAG79hqV0GpsNNcH0DUsAw6Jaq0T6z4w7GAx5DO/ Sy1lqpXkwxnrQ0Zli/VbU3Z7d1jJA6n6jw189BIQSuifL5erV08ESTKfmdPnq6E2UzvW jmBHu3nJ4pCIeRaiO3oRyp/7zk96yRtv2VRn9wEiB5Lvw/4qt0OksCnYukou6ya6aoYF 7tvw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="O2lU76t/"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-30391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j21-20020ac85c55000000b0042a0e68c831si3740033qtj.120.2024.01.18.09.03.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 09:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="O2lU76t/"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-30391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A2F631C217B5 for ; Thu, 18 Jan 2024 17:03:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D8542C6B8; Thu, 18 Jan 2024 17:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="O2lU76t/" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 05DF125770 for ; Thu, 18 Jan 2024 17:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705597422; cv=none; b=G6IMYz45STOFhgtL4mvyfNbkSImO1YFlrBWt5q2bmqWGRi5gTnpOQOg5aOXV6YIIthBiQ1LhTz9F1RD9p4t7ykAviOedGG6AR7YhnUkPvMQXBAQ1bavYsKwb8oCc/UWtl6ib9HCSLAc61I/aG1aiuIAlD7QPVTXN5lB2sQp0OcU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705597422; c=relaxed/simple; bh=Xf0vVZ0CtTzvbv85PyOM6avhkZxNdVgvuagjNBhMa1Y=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version: References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: Content-Type:Content-Transfer-Encoding; b=N4fqjq6USvv73W4kyMkR0ZHi3gTGOoxo8YTLCW6cBTrdU9dh5qgZ0SUTHtRGKCHX9clCAwxblfR5vGxGQmRoGqsFAAu283ZswCtPs89YMSVczBE7Q1OpX/Am+H5R3lM8T9w66VUkOqlYz+Y52TLgRJfJVfwmI5XT4qIPUlj6S6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=O2lU76t/; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55a45a453eeso455213a12.0 for ; Thu, 18 Jan 2024 09:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705597419; x=1706202219; 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=I307JXW0PD3nSS/XpS3TGtlMDXTLZF0yfATueCQN9yk=; b=O2lU76t/64m0d1/ZEP1LQfa7s1/pDFGJkIqkQftSHgfGCced079mY1aJw79LEr3jY/ riyOmYXjhDzfmfjJOwlRv5HkUdaBMv5KprvBUf4Dq2Q7W08s7V5yVJIMRN8+GJ7DX4Nz dStyNkR+NZVPBD8dp5pKX6ARPrVk0HoiionD0vE0IXKu+5HJ3jZGd5L2Zb+pyZ1ppjQO XwrRBqNDDCVvDZz3xbjL/QyxkBOsusPSnBT9MMtkxJif5sHwRcJKErHGLv22gYyQnUoe 1b2U+WKOxqz5pkEu09DW+mzed2fk1k+aY1QNCTgU1Po9GdFFSzjm0QEXcV8LdNUCAaQk 3zHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705597419; x=1706202219; 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=I307JXW0PD3nSS/XpS3TGtlMDXTLZF0yfATueCQN9yk=; b=qFKcmGEJ1pk2E/lc1uJgW3lMfA3i9SdQG+d2B8mb/NUAIpirgkG/ttfh9myhGZ8qGM 4mz5ZnsixpwRAb7/JASrlr2M6eFMua4tXbT4+zTimL8lRnYF2qVpinPaFyOrP3wBjYuo 06AcmM8+7F7qGjqb6xSuzJjYhSWOZ/kLQIIDRwvywe2ks/ViF3UGq1ZujpN5j6wjUVNd QhflXX49fCv42TS6hveKsvK1X754+Gxw54UaGn7se8rgIdxRrk/31CmzERIMFsRtJgbA iMURiEunvZr6V77lYUHQs9PepJKi1ZCvp20wFrAFwixZ89C49Sq0qtbQceMM+PwfjWEe hmmQ== X-Gm-Message-State: AOJu0YzexxvrQTJBpmHdtND8DedfkEUGDYeDIsyNfgZ32EFA6V8uZLDM NXcxaReHA8B3v6eGoxx1P670cfAfyaGHtJaH6xZJxBv7LZtIyekAzMfdCadZmi5j2uo28CzQmr3 h4GFeLRYwOCQzk1tJCDafTastOKH+xxqXF/3Z X-Received: by 2002:a17:906:ca41:b0:a2e:d88b:53ae with SMTP id jx1-20020a170906ca4100b00a2ed88b53aemr674261ejb.129.1705597419020; Thu, 18 Jan 2024 09:03:39 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240116133145.12454-1-debug.penguin32@gmail.com> <20240118161601.GJ939255@cmpxchg.org> <20240118164839.GK939255@cmpxchg.org> In-Reply-To: <20240118164839.GK939255@cmpxchg.org> From: Yosry Ahmed Date: Thu, 18 Jan 2024 09:03:03 -0800 Message-ID: Subject: Re: [PATCH] mm/zswap: Improve with alloc_workqueue() call To: Johannes Weiner Cc: Nhat Pham , Ronald Monthero , sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, akpm@linux-foundation.org, chrisl@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 8:48=E2=80=AFAM Johannes Weiner wrote: > > On Thu, Jan 18, 2024 at 11:16:08AM -0500, Johannes Weiner wrote: > > > > On Tue, Jan 16, 2024 at 5:32=E2=80=AFAM Ronald Monthero > > > > > @@ -1620,7 +1620,8 @@ static int zswap_setup(void) > > > > > zswap_enabled =3D false; > > > > > } > > > > > > > > > > - shrink_wq =3D create_workqueue("zswap-shrink"); > > > > > + shrink_wq =3D alloc_workqueue("zswap-shrink", > > > > > + WQ_UNBOUND|WQ_MEM_RECLAIM, 1); > > > What could make a difference though is the increased concurrency by > > switching max_active from 1 to 0. This could cause a higher rate of > > shrinker runs, which might increase lock contention and reclaim > > volume. That part would be good to double check with the shrinker > > benchmarks. > > Nevermind, I clearly can't read. Regardless of max_active, we only have one shrink_work per zswap pool, and we can only have one instance of the work running at any time, right? > > Could still be worthwhile testing with the default 0, but it's not a > concern in the patch as-is. > > Acked-by: Johannes Weiner >