Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp141298rdb; Sat, 17 Feb 2024 02:20:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUW2jQra8aqoNGkh74XzurZW8ZlNeSRv6NwJvwDnyU/KL6QBr1nWjnlaH18pFxtVB5E/bfqtpzuv4wgOzgi8RdMKcULyq+s/DXZ+DB1Ag== X-Google-Smtp-Source: AGHT+IHnNsR+v6mYxz7rRa3WUh8JTsrYNo27mceuMnrjHUwhZoHtEXZlhUdi3Mxo9xqDDsAJvCfK X-Received: by 2002:a05:6871:5ce:b0:21e:7a56:a501 with SMTP id v14-20020a05687105ce00b0021e7a56a501mr3080686oan.38.1708165200510; Sat, 17 Feb 2024 02:20:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708165200; cv=pass; d=google.com; s=arc-20160816; b=z9j74o8tZIdloSbg387JJJcJIBIQVzEzmut53W4PLAcMp/vRs37v7MQNl9VRPAI6LC eSckQkNg59KjwkF2qcYpsC42mjRU1sIavWakMKE5K4EIk2697IXpCvT3jmlpnLw2ovt1 O1DTlJ0RU1RRqKpW1UizCmueNQDUDZ6RSiqnQFUC/g/66DbHQI/LVh1cNJlvwkz7qOJT hNP4Ca4o2M76XMdklqa5dIyL2muY+4P0cl59rK3ffMrt2GIHzg4oS6ziyqRe9tgPjjWK oIVqvRpfwnQ6tDUe/+YmERprbcAZD+0P2Lkb5rky2Gh+3igvGVAVT3FOn+sLsJpoNV9J 98RA== 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=uClJ3fAlScaq3NqQwR+2Ic2/qYD/92ld+NgmLu3RlS8=; fh=4KBw9W/MqQm3SEU+zuprEVR4BMJKUFm4jt4EHxU1/yQ=; b=Jv/qwB4bstxoe5Mx1ET/RR+StnSfN0c4EdOFqekE0G+cwiFk0Uq6E2Clsrx3GNVoSB Rq3TVFnb3c+ZNV/jzKiscgA54IBEGT26Q1ttj85zGp8KYvSb4HB0PzyJ2mHQVSy2V3ZE Cf7/Z2dUJNz0piFqTZQa6LiCneT5SvvGdIVjwlJ3hBrbkKb1lKwXB+pJStfq9AkE5oRS S1YYpIm9OY97hebW/lLxN1ZG+Fr4C7sUH/LG11Ga7K1HO3W8lTyRTCVANTJ5Mh88rash 8+bSljTrfwfe2bPsF2V/7ztsvADQQjMuVrD2AqeUi+MEA3xYtLBeNmzE5AtFILJh54rB UPdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ji+BHswJ; 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-69795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69795-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 35-20020a630e63000000b005dcc035ca8fsi1315334pgo.561.2024.02.17.02.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ji+BHswJ; 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-69795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69795-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 04581B20E5E for ; Sat, 17 Feb 2024 10:19:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEB481EB4D; Sat, 17 Feb 2024 10:19:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ji+BHswJ" Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) (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 918A71EB3A for ; Sat, 17 Feb 2024 10:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708165156; cv=none; b=D+/EyOE4zu9cCKNylmruKeStgsdEOx+VlccOPRS/0Okb8jM+AXgaB+cscfwy/LZ8BuSGlKorOAgDGyuHpwfezRerYrb8IE8axCftGqeeN8a3mRcJVLYfqmKJLIrZJZZyvJfCMrQx3SyfPqpmfzCswMw61j3IK0PmJLk8qFPs3yU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708165156; c=relaxed/simple; bh=rr9GfZ98kNf1r9adRYgyXB17Nc+N7JFYTnjcnjoO+MM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jJKObgHl+JIi1McU1uuw8fUF/ffpBXn+Ho0M8klYxiugWMpxRuDfatPYQzzuHmx6XAQ4exS9pS3Reuf3zOT7bTGnYr/9xivARIuqJZw/vTG17SSZOPSk1wUa6i3Yn+ZRB6dM3H3KfY0iatjvEhI3XNQBilwTKFQ5H8FeG2gMCAY= 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=Ji+BHswJ; arc=none smtp.client-ip=209.85.222.47 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-ua1-f47.google.com with SMTP id a1e0cc1a2514c-7d698a8d93cso1752784241.3 for ; Sat, 17 Feb 2024 02:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708165153; x=1708769953; 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=uClJ3fAlScaq3NqQwR+2Ic2/qYD/92ld+NgmLu3RlS8=; b=Ji+BHswJM8bkRJkx1jlDY7lrKwLUwdSLVmKH0+nCgeMI1r6scoh6oH2k3Y0O17rFM6 bAcIbirR4E//COXo/6i2zvWLUzSqggBC34DDrX+JodDbRRvepKl6RakjON/73Ur4Ydnm c4AvMzqKbm0lLFQQExbAAQJbDCM005J/iUqpqdi7MaHPyR2Ss9jzgSj+ff3YH5vS4HsN TvzunSLP3KEoMCbIB3nZxlSQizbsqNiVJmJb9RjkO8DLMThSVnqbzU7MnzhmJgeWaHx0 hAHETtViMdFyaO9x3z5r9vNNCYVGlFqD90uuX7mCHiTg3ObHquY+p7q2Xkdkj6qpmMM4 660g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708165153; x=1708769953; 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=uClJ3fAlScaq3NqQwR+2Ic2/qYD/92ld+NgmLu3RlS8=; b=KGruqAMm1Td7oXHYX3JuJRGev7f5H0IhzOOS1rIUjM43yJc+ER1jhNLTs09kysZ0ci IeQHDBmgClrQP9yiBqH0Kvn3SMo0PYIveAvwa1YVGBOXfBI1xHQNTPhz6fnzkF4vGtci ibS2JJoVcY3ZG6P9sKTqLYhM2aR0A6hLKgeiupALuTOIT6irwqp1ft4gyyM6c70+tfSD btaZv7WhqCBZcXlQInmR+Dq9BP8mCH1YhYhgEHWeM7d2X9zTn69D5gXMKT/IVCmKhIwx aNd1IfWaXq+WJrPuoaaH7eD4zXwU93XZc7zD0UyNjmA8z0HLAEcKtpGPSgV9oGZad+nS rGVQ== X-Forwarded-Encrypted: i=1; AJvYcCX8IZM8UG4iWiKb0JHVRm7qkZxX5D66SiqYLMxn8rWNfCE74CQl2K4EFI/1yv20J7oygA802rjXEdAcgLOgO/66YpdGlgKnjzowMrAG X-Gm-Message-State: AOJu0YyhDiKPd2cQqzePCoxQA54uZTbxVATdAAR//17ZALA8b41tEusN XRwp+L2CgyHi9Es0qtDlfYWHhycoH7vl7RAy7OGOGq4NSt4Q9iGGXyhje+pOfb0fco+daoxRoMo 6fXVLbn41kLpTLfNls0fszm9gSAM= X-Received: by 2002:a05:6102:2385:b0:470:4514:506b with SMTP id v5-20020a056102238500b004704514506bmr284887vsr.3.1708165153533; Sat, 17 Feb 2024 02:19:13 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240217053642.79558-1-21cnbao@gmail.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Sat, 17 Feb 2024 18:19:00 +0800 Message-ID: Subject: Re: [PATCH v2] mm: zswap: increase reject_compress_poor but not reject_compress_fail if compression returns ENOSPC To: Yosry Ahmed Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, linux-mm@kvack.org, nphamcs@gmail.com, zhouchengming@bytedance.com, senozhatsky@chromium.org, linux-kernel@vger.kernel.org, Barry Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 17, 2024 at 4:57=E2=80=AFPM Yosry Ahmed = wrote: > > On Sat, Feb 17, 2024 at 06:36:42PM +1300, Barry Song wrote: > > From: Barry Song > > > > We used to rely on the returned -ENOSPC of zpool_malloc() to increase > > reject_compress_poor. But the code wouldn't get to there after commit > > 744e1885922a ("crypto: scomp - fix req->dst buffer overflow") as the > > new code will goto out immediately after the special compression case > > happens. So there might be no longer a chance to execute zpool_malloc > > now. We are incorrectly increasing zswap_reject_compress_fail instead. > > Thus, we need to fix the counters handling right after compressions > > return ENOSPC. This patch also centralizes the counters handling for > > all of compress_poor, compress_fail and alloc_fail. > > > > Fixes: 744e1885922a ("crypto: scomp - fix req->dst buffer overflow") > > Cc: Chengming Zhou > > Cc: Nhat Pham > > Cc: Sergey Senozhatsky > > Signed-off-by: Barry Song > > --- > > -v2: > > * correct the fixes target according to Yosry, Chengming, Nhat's > > comments; > > * centralize the counters handling according to Yosry's comment > > Yet Yosry is not CC'd :P terribly sorry. I thought you were in my git send-email list ... but you were not... > > The patch LGTM, but it won't apply on top of mm-unstable given the > amount of zswap refactoring there. I would rebase on top of mm-unstable > if I were you (and if you did, add mm-unstable in the subject prefix). This patch has a "fixes" tag, so I assume it should be also in 6.8? > > Acked-by: Yosry Ahmed thanks! > > Thanks!