Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp519801rdb; Thu, 18 Jan 2024 10:08:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEaHEJ63JhDxXtrqv7S3Z5PkfWxBTRhjmdIHQuwi28gP7yXgawvVqE92FSqheBSMjTh5AJr X-Received: by 2002:a05:6359:6402:b0:175:57b3:55f3 with SMTP id sh2-20020a056359640200b0017557b355f3mr1201074rwb.24.1705601311362; Thu, 18 Jan 2024 10:08:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705601311; cv=pass; d=google.com; s=arc-20160816; b=ahtkYphHYUnWy0D7k7uXYmw9VjbYfnvVcphUeqjhMlllSE+hsMUwEVpdhB5RQtEZ/T /RxMUwo6sz+83bwP/t++TkZKk6ndLjOphnijgYgwJogxSVUQrraP7t05liPg3DELIEM/ U21+sXYTwP8nkCtn2vtRFNITFh/k3foIR9gYoe6Ufgr78CnUpMcHtNXdOtSCxKmn4VGl B9p5LK97QJqgEQZAWyz/0QneIEuY80krJcOs9sM8HTyOTTvLZWu7qB7nU/rWKmPG8rFf hHngyVVrV4U9rsCnjbvqPxt8lAYCgicTc1mOvgETvfGrYq/UhMAK2P1gvsklwZ7+0t9K gH3Q== 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=n9oyBIjEpoT3XMaWPjAXVyQ5+LqPNizEst4EFi9ms0Q=; fh=k0n7eu5gehr2kN2FEbhbaPwIfqY9c3ealjGLoBlavB0=; b=mrtPvGldlCSmF1fznmIzHO6omYIzBPVrzPl5TBEhUnVnnB5gRSg0YIL5pCgH96S/0J /V7RvmF/a218gtPJR7uU5z0qfZllJ9sFJdVR1QqCoeuz1UVM41cFmFhVp7n/pzAJ8ywf 7jVxTR3kT8N/fgsiNRiObhwSTCk6VCiuiYlCBJrsgThcVhpVkO5Nx7DJaYmekCRC7dDL H9mI3KRfyDoGz1SCg7hr7VfIBceTMdQYougAX829/aLoUtedUtG4vm6TmdSIOTsmYyEa yKh6Eyswrv+emKP0bgkzP83FjFFdVkdNjyooFnpm78YPv/woexJzMrvgJi6oL+V8xto3 5YHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="MCqXL/3M"; 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-30457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n12-20020a6563cc000000b005ce01026222si1807576pgv.49.2024.01.18.10.08.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 10:08:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="MCqXL/3M"; 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-30457-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30457-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 F31FF28BB30 for ; Thu, 18 Jan 2024 18:08:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BD0D2D615; Thu, 18 Jan 2024 18:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MCqXL/3M" 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 7EC2C2C842 for ; Thu, 18 Jan 2024 18:08:21 +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=1705601302; cv=none; b=JwECGLZJx1+3EXZscxp6xXtGQrlCK7E1bvF/0TQSYNjwaQFWmx+BXpUOpI8hHYU+p7GdkJUCREY3izkGCmMhouAZeOQt7qdaz5LLhEqtq/0qjqBKVsOpZmJf5pjfxhcjzIWgolg2boe9O076JU3NYMi0PVQYEiHYj/6uE1S11nU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705601302; c=relaxed/simple; bh=lb+KFR5UwwKootoHG78GkwJ5LrRDGOQzgc5mdvn66a0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=D1R20eo+ck1DbYqKZu6YNEg6PfQJjy3zUHn7aC+d8aRuyhWF0TFFM8Cr/ypI8OglSV4IuP9Oj858ExWmBJ7ygUMG4iddKSlJqrUpdl8Dxt5S88/WH1pmnBuIPRhKz1aJctFbcNPst+YKAUa55Yp1WUYNR8NegpRYhpkREhyxPQA= 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=MCqXL/3M; 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-7bee87b2f5eso261547639f.3 for ; Thu, 18 Jan 2024 10:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705601300; x=1706206100; 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=n9oyBIjEpoT3XMaWPjAXVyQ5+LqPNizEst4EFi9ms0Q=; b=MCqXL/3M5UGJPztQoGpoOCz0JVYatYKsM2D2p7GB4LBHTH+LXVUZcIUKlMeKrugy7J ckelnOV7o6YF7zRuLO5VLvdoiv9kfzUEgEYYV+ytOkh+NBgXXNYTB2Gv6tlWN2tPTsPk oZm4pVpJQQbaV8dyWiIHtWWwUxmkFQk646a79YLye9g8XREf91CsXYHCXWsQsERc4C6e To5vm5fvn4mkaI9t9dO1UHdJNOipk5YVGpFSFsGB08LFDC/L3N6g6jbFhzdTH/o4/iG/ q22WwP9VjlArUq1K6FLDc8WxN+viqrAfYh58dHJ5/CUsMlUROHhP8tGINKc1t5H4iurh lnsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705601300; x=1706206100; 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=n9oyBIjEpoT3XMaWPjAXVyQ5+LqPNizEst4EFi9ms0Q=; b=Vh007JTnJJLI9djaMd1whBpLw8paGF9zBEGEfM9GImIb2PJFqbSAYvFOBtL47+7Q/m pCzA9rhzNDRhe/1C8mMMGFu1e0Ftoie0AdIhq2q4QkZ0ZvMRrJuAnc2N3VSOL/qXyyiz F/qpgbeeYo5XEUdkQ//PhGuLlX+lsnGnuZ+56XQyVAPvTqk0YFNSjGp7h/GpETBg8Q76 u/2nvXgigiFLMGLWo5KoZ/voqdacMWKheYcm2Tz9F5SnWr/lmm64l6g8lbHWJJNAJuny GTZ2EL52BPSJQ2e+n0fr1U6DAktCvOiqvb0jADGVoxVWhVG6ZZNB8w0TufELv1qXOy1V zWKg== X-Gm-Message-State: AOJu0YyPjVK7Wj+cHuMVkKXRzJxUWyO5Z5e99OB4HD3oIg8VTdDfZ2GT GEy1o1XYEaz0iVmC6AS8tcvkIes4ScfuCk2+5j21eQHoE+gnNXWYFOwqi9E/fodY8KVYyBvSQ5I FNONwq1PD+kavFt4wAs9QKEuKb4A= X-Received: by 2002:a6b:ea0a:0:b0:7bf:37b7:b0c0 with SMTP id m10-20020a6bea0a000000b007bf37b7b0c0mr1609603ioc.31.1705601300656; Thu, 18 Jan 2024 10:08:20 -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: From: Nhat Pham Date: Thu, 18 Jan 2024 10:08:09 -0800 Message-ID: Subject: Re: [PATCH] mm/zswap: Improve with alloc_workqueue() call To: Yosry Ahmed Cc: Johannes Weiner , 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 9:03=E2=80=AFAM Yosry Ahmed = wrote: > > 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? I believe so, yeah. Well I guess you can have a weird setup where somehow multiple pools are full and submit shrink_work concurrently? But who does that :) But let's just keep it as is to reduce our mental workload (i.e not having to keep track of what changes) would be ideal. > > > > > Could still be worthwhile testing with the default 0, but it's not a > > concern in the patch as-is. > > > > Acked-by: Johannes Weiner > >