Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp683457imm; Wed, 25 Jul 2018 04:30:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd5IP7K9VPAVVFE2u8y4vs2TkYbepdHiu6Jyb92l6mQ3KLZyRsTRhwnLOMTTrFo7IRZZrI5 X-Received: by 2002:a63:7252:: with SMTP id c18-v6mr19644935pgn.186.1532518250288; Wed, 25 Jul 2018 04:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532518250; cv=none; d=google.com; s=arc-20160816; b=pd9txxRjpRGiYes6pst60ho9N+sb/xkHt1sfcHGsnCjmYWlMjnXRnZr5SwGtv4rp1i d22KhaZkOSIve+4tFyJ6942ygHzCNQTibPjqWiMSHxs6uLnAAPu6VTJtlTzlhkfLz9ro 0dEcT1MvqJnGLmDJ39KnbZeJAiJxKz5hqLVVSY8vD7ya/ZeFoR9kXo/DQ1cBXtDu3Pqn eFN/CV+hRoMPMTt3YD2F88PL6FmJi00ITaVYykxLJH3sXGWORQWYlfGW3u2iwDH5cf63 wp6PYL39MVBsdRx/CWvnDqQ25kze8jMSFMm6PXbZ+JgskfTQledOdRl7+o4/8rO7PBxF 4OEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=CwpKs0ux4OFYlnFMm0JKTpF/7RbqgkuSPEk/KHisviY=; b=T8+Nhe0nxldPOAbvKY8RCNqR5zJKzV1cLC4Q8pYus3qwAbtSGc3yVhmFKhsP9iLroV Ugl1zJiv7zgx3LAW+1n2cW7SfwRrT4V+W+n1H50KsUbwOw+bYMNrZnbPbSUbyMsdxOwH VylkP3Q24KE29kEm1VmzP5K+0ODfj+uBcR8Wdp/Uv+y04N+Xklc51cpsJjxcAR7jFl3K xZtjSn7PsQ7wOvGirvr+3zu19fZRc2tXrlyUOvrTojjWWfufFvLU+h5qB8XxIL16mOS/ iApFZNpyxrRa6K35XGjuhrUyr/KaDaIJKePHJkdgHgIQJrPBhe5SKqR3xIvQnIckhMAy ntug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee-org.20150623.gappssmtp.com header.s=20150623 header.b=fuOfvuHT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si14887104pfb.227.2018.07.25.04.30.34; Wed, 25 Jul 2018 04:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee-org.20150623.gappssmtp.com header.s=20150623 header.b=fuOfvuHT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728797AbeGYMk6 (ORCPT + 99 others); Wed, 25 Jul 2018 08:40:58 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:39482 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728474AbeGYMk6 (ORCPT ); Wed, 25 Jul 2018 08:40:58 -0400 Received: by mail-it0-f65.google.com with SMTP id g141-v6so8148616ita.4 for ; Wed, 25 Jul 2018 04:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CwpKs0ux4OFYlnFMm0JKTpF/7RbqgkuSPEk/KHisviY=; b=fuOfvuHTdl9/n6OBz7yqa+b0JDdM8XsQOp6/ZKrCaIikCGrpTQDhOdHO2N0VuMEmfJ OApB0cs/0OqjUx8Gm6v3nsPvQohBKk4HKzjo7xsu9Cvx6NnmeeZJCI7oWUSy97QX4rMp 4JhmDU5U3r4+RRplZfbR0Tibgd/PXzUFX+aVscB4aoCLnwpj8mRYeyUcm+50YK1HGpEI ui1j+jJQfhNvNu9cWIvZc16R1w/wSgQ/GT/SCsGkakw8Ma3Z+yLdpyMNmQs88gw7c+iX x8QZaUWzpp68/hWLxqrk3hAkpVw50qyCYspZzSg2IVlCatgQMkwJE4fpaGuqavLUNzEz cAaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CwpKs0ux4OFYlnFMm0JKTpF/7RbqgkuSPEk/KHisviY=; b=J4wc4h+XALt+PmQl+iYC0U/UWwiUVfcUMttDAjtFBaZPI0IgiA/vCt9yI+E9Os5dXT Zl4NtrhW7cYB86zajvapCgfQQfO0WTAw5da8XZMHWVkzVKe6YxEom/xxf1PkplheUj8e iHR2kE3RPObhG0Icbc5oALUe01lur0bWkKGPcDJuz4rIczUWXFOy4ERpWikfZ1FGinup gxK86sI+tqZ99Fla5KAfoyY1MbS2OSR0cD3Yxmptf6ISoJmEo3WAA8qqAzdWbxngGfyF f4vcKOkU9oXaXfWODMDPSXa3r5XQem075hmm6tm4ToHD1IpLLwXMpm0Zn5dNo5oWkqXQ YBSw== X-Gm-Message-State: AOUpUlHAKCWe6PqKRffjX8utzxn7RFC5TyYy9GzUFgzPhJPem1jaKcoD sxyLzzgaohd1tK4iIEQh//LxjbAw9ndX5PRR2TU= X-Received: by 2002:a24:eb0e:: with SMTP id h14-v6mr6362848itj.69.1532518182222; Wed, 25 Jul 2018 04:29:42 -0700 (PDT) MIME-Version: 1.0 References: <20180530103936.17812-1-liwang@redhat.com> In-Reply-To: From: Dan Streetman Date: Wed, 25 Jul 2018 07:29:05 -0400 Message-ID: Subject: Re: [PATCH v2] zswap: re-check zswap_is_full after do zswap_shrink To: wangli.ahau@gmail.com, Andrew Morton Cc: Li Wang , Linux-MM , linux-kernel , Seth Jennings , huang ying , Yu Zhao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 4:08 AM Li Wang wrote: > > On 30 May 2018 at 20:53, Dan Streetman wrote: > > On Wed, May 30, 2018 at 6:39 AM, Li Wang wrote: > >> The '/sys/../zswap/stored_pages:' keep raising in zswap test with > >> "zswap.max_pool_percent=0" parameter. But theoretically, it should > >> not compress or store pages any more since there is no space in > >> compressed pool. > >> > >> Reproduce steps: > >> 1. Boot kernel with "zswap.enabled=1" > >> 2. Set the max_pool_percent to 0 > >> # echo 0 > /sys/module/zswap/parameters/max_pool_percent > >> 3. Do memory stress test to see if some pages have been compressed > >> # stress --vm 1 --vm-bytes $mem_available"M" --timeout 60s > >> 4. Watching the 'stored_pages' number increasing or not > >> > >> The root cause is: > >> When zswap_max_pool_percent is setting to 0 via kernel parameter, the > >> zswap_is_full() will always return true to do zswap_shrink(). But if > >> the shinking is able to reclain a page successful, then proceeds to > >> compress/store another page, so the value of stored_pages will keep > >> changing. > >> > >> To solve the issue, this patch adds zswap_is_full() check again after > >> zswap_shrink() to make sure it's now under the max_pool_percent, and > >> not to compress/store if reach its limitaion. > >> > >> Signed-off-by: Li Wang > > > > Acked-by: Dan Streetman > > ping~ > > Any possible to merge this in kernel-4.18-rcX? My zswap test always > fails on the upstream kernel. cc'ing Andrew as he may have missed this. > > > -- > Regards, > Li Wang > Email: wangli.ahau@gmail.com