Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5419506rwb; Mon, 21 Nov 2022 22:54:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4R05Xt2v/er8NqCCN/+x2ezVMdDGe7lPjOhOzS2exQgqQZY7WSGSd0jbR4dgFybkemEju5 X-Received: by 2002:a05:6402:176c:b0:463:c5f7:fae with SMTP id da12-20020a056402176c00b00463c5f70faemr19091403edb.152.1669100082558; Mon, 21 Nov 2022 22:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669100082; cv=none; d=google.com; s=arc-20160816; b=LnbG3bY4mpoCeWdhweRqhT4tEbHhAU/Pw4azCc1DVZ/tvNYON1XI6vn3OmlfnR4YaA 8eThQ6sq4Q6bgwsGDQolESNSUoJPLEr9iSjDnkP90wJA77JBQud8fc8tuW5YydtcDwYn /ClwVNC7eh6+hcMVASydoUK1ulwQYbIa1T12PpSAiHnYSiq7ZQlng7frvzSuLhYBPTrM OVbss8CbcL1EAQSrzqUv4gV2yFA8DR370AWDK2oBHgUz7IvGtsm2pbHJpDe4FwIkFTtG 4kkgcd1Ya8+19lj/IUp/L79v/cZbXMzoSXZI0vBMgNQs/Jid2KJv+aDez0UKp7apnTJw NcFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BZcw3xphyFpaMwrz2/RfL1TkxCNnDZvBvwaHcEozeVo=; b=nJjMpnHN6PFjyapBMNQb1NVSPCkLYMDUaZtYwWP1bt8DlOzNKqdQvN+gkZxRPASKfW 7Rd23JJuE2rY/kJfuKxsg97ZAPXq7ezSK33SKfhZliOytCY9sdzzIXk0Rx1W6OT56KO5 c0Krw3XL4rGU2fZJAKOlMLjD33bC+HsD4tvn9GAnhXfQdZLmNyw1MNEJtH8nJBI2JlfW AnIE58NQaPOhvliPheaW/xlCYr4u0PcRJOY1WBjSwA6N/4/S9x7FOr44PUyg7pLH6gUX Y8lT3gVPJPmVGWnbB3X5WGR62xU9/90ZF7M0gq802jErYeWlv59T1K0a5GqdeG6nWknw n7yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gc9iRvo0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a056402348a00b0045d5a712e82si11962326edc.586.2022.11.21.22.54.18; Mon, 21 Nov 2022 22:54:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gc9iRvo0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232080AbiKVGf0 (ORCPT + 92 others); Tue, 22 Nov 2022 01:35:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbiKVGfZ (ORCPT ); Tue, 22 Nov 2022 01:35:25 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6B62DD8 for ; Mon, 21 Nov 2022 22:35:24 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id t17so11756318pjo.3 for ; Mon, 21 Nov 2022 22:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=BZcw3xphyFpaMwrz2/RfL1TkxCNnDZvBvwaHcEozeVo=; b=gc9iRvo0HrISQTXfnCpl6IEX773OMidfAI9E+Bb7/VBj5N0v4YGejsaBNYalbQcr7P ca7cJyaLQXrWjybpdkYaCoP5dOAVQ9l0p2JXEr9RDeLXUB4dSPZyPOcWNGS2RPBynVBP Y803ZBp6/+ub5d150Lwt44vPD+OpF7ztHLoN0= 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=BZcw3xphyFpaMwrz2/RfL1TkxCNnDZvBvwaHcEozeVo=; b=uLUZvUKVJUBPFJiFqIiDJ/vm7G4TzuA6POHtoL4uoPUobcI8XNgavO6oUoe699k+6p wFLgcswQfbdGI0M/yBeL8FCTE7avmzoGBxWORlmH/phcubNMkQyuVuAYmrk/yqb8S7zQ bp24fyVJwfVli8rPhUvp4GhlF05EnP5nij0SPk42T8Fo5c6duMb95VrhybxIwkj36BeM Z6o0jLHTeKSfW35sba9ifrDIAqwiilzGPQ8uDvvgu4AQmR4+YbEzlkx6zLgodqVUR1Pz L6+7JXrDMGexn2ky4uhMe0xxuHshWX9HrDLDUf1I0AT6u5PgM29NVG/H5qLgLwky/wlf tGdg== X-Gm-Message-State: ANoB5pmxsjtH0EEaBiuxiXs/yzJwHNgnHb53+BqRia38K06LV3tsaI4Z qEY42ue3eJ25FqiP3iZI0GlR3Ox3MyricQ== X-Received: by 2002:a17:90b:2542:b0:1fb:e7a:79b with SMTP id nw2-20020a17090b254200b001fb0e7a079bmr30708699pjb.93.1669098924054; Mon, 21 Nov 2022 22:35:24 -0800 (PST) Received: from google.com ([240f:75:7537:3187:e258:71ac:37b7:2d52]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b0016d9b101413sm1472468plg.200.2022.11.21.22.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 22:35:23 -0800 (PST) Date: Tue, 22 Nov 2022 15:35:18 +0900 From: Sergey Senozhatsky To: Johannes Weiner Cc: Sergey Senozhatsky , Nhat Pham , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, minchan@kernel.org, ngupta@vflare.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH v6 6/6] zsmalloc: Implement writeback mechanism for zsmalloc Message-ID: References: <20221119001536.2086599-1-nphamcs@gmail.com> <20221119001536.2086599-7-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (22/11/22 01:09), Johannes Weiner wrote: > On Tue, Nov 22, 2022 at 12:42:20PM +0900, Sergey Senozhatsky wrote: > > On (22/11/21 22:12), Johannes Weiner wrote: > > > On Tue, Nov 22, 2022 at 11:15:20AM +0900, Sergey Senozhatsky wrote: > > > > On (22/11/18 16:15), Nhat Pham wrote: [..] > > What I meant was: if zs_reclaim_page() makes only partial progress > > with the current LRU tail zspage and returns -EAGAIN, then we just > > don't increment `total` and continue looping in zs_zpool_shrink(). > > Hm, but it breaks on -EAGAIN, it doesn't continue. Yes. "What if it would continue". Would it make sense to not break on EAGAIN? while (total < pages) { ret = zs_reclaim_page(pool); if (ret == -EAGAIN) continue; if (ret < 0) break; total++; } Then we don't need retry loop in zs_reclaim_page().