Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7621576rwb; Wed, 23 Nov 2022 08:40:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6K+xC+yf4kvkngXEZfvkvRObYRBrrEjx5BOxw+a8hIAO9/bbt7hpxPrT+V46FHXTaCzkPq X-Received: by 2002:a17:906:d78e:b0:7ae:c0b:a25e with SMTP id pj14-20020a170906d78e00b007ae0c0ba25emr8177103ejb.603.1669221658886; Wed, 23 Nov 2022 08:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669221658; cv=none; d=google.com; s=arc-20160816; b=EBdiPEPkb97NkrCwMX+f+sGF0twADoCCmNoeRT0ozIdzeHQXmKXy+FlBJosBvnhfTx TaQmmK6/szUbauIR5ocn7zuKb4k7U1dkA2HJYmqk7Cdz+bWmldSHM0DDrVJnU0TmHLE6 o6dQ7/xj1PD/Dm8jzHB8P5v7N8IEsGnEr4nP7BGl6QurPs64oN+6o//6giirJg4hpdeJ b1GkOK572ZJZSs2LnJhIJoiJijeq+yGDAlAvHaSd6dv3dJkZY00jSqfCny/IURF2OPWV GWHL+lj/nB5lbZELbRLbq6OGhPfmfxF9K86G6xY6wUoOSTmiDbneGrcYT1v47Idwsj0e 9Maw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iViwIfECIqhBr9fvxYi0Xo/aU6bf+FR/xO4cSLXF8Bc=; b=x+2AqA+kiWaaf9L9cMBJy3Ct7W3p6UDjgfA1f21noubztr9PgJA+wvHoF7ZmE+j9mg eEWPEt3YeBrxKDhSsGUGL1z1tmxfUQD+2y8mL86G5DSmIBThaINBJ70AKyl4hy/hULGp kCbYsPPAc5e3CLdWXlEitBEFoCMJMWtDaXCrSsPsF8gtZH8fIAKwycs/UKv+RjdaIHsD jNHlF6AysPC28v7eEO0AAGzN2/1BW0vr13oFJUR+d9XLruF75WRsfmq+n/8WuYYs/8WI nmKMS3TRgLvix4uBRMoNXSPY/nO+R0/oloiCuVKNGthtYZgs1cNiAPSWjRVYtDCRSQnE c4aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RzbR+elN; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k10-20020aa7d2ca000000b00469acead38esi6428938edr.1.2022.11.23.08.40.33; Wed, 23 Nov 2022 08:40:58 -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=@gmail.com header.s=20210112 header.b=RzbR+elN; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236917AbiKWQaz (ORCPT + 88 others); Wed, 23 Nov 2022 11:30:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238191AbiKWQar (ORCPT ); Wed, 23 Nov 2022 11:30:47 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BA75A6EC for ; Wed, 23 Nov 2022 08:30:46 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 130so17193007pgc.5 for ; Wed, 23 Nov 2022 08:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iViwIfECIqhBr9fvxYi0Xo/aU6bf+FR/xO4cSLXF8Bc=; b=RzbR+elNzGu5bIsu1/MfFDtI4kni7yJZZoVH9tIE8j3ZVC5EgnWMjLNVyoQMfZffgX dtD9hxMmaJtL0djAJ7GK6P4fW03HJqtSvHduWF9ysAraPNn4VHJnBZHbzNYy/AWo9maN OGSbkn/15tuCWLB/z3sklKUZ0k1mOLbtrwXpOM5zICSy2sJZGwwPQIuixuNsHrBzr6XS GzZMH8HH7kV9ZgkaZMHIQq2KA8bdC7HEbzD+x4kwK9MSaF3WIrV1LJ0PbPMKf0llTPxI J1QUWMHYodUqx/N1XONJdCq4fhC2DbIcix5M5twc2leTTzMwGQWGjKjEHyh+NpHmikFj ejlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iViwIfECIqhBr9fvxYi0Xo/aU6bf+FR/xO4cSLXF8Bc=; b=3Jr/LlOUnUEzHhZWJMZ2UudkYwtV7qRhyMLhUErcPmWKztadf4EiGBdaJerLyg5sUY wHbagrayYdDKHoIpEapBEWqxf7xnVjP6RzR1fUubZxzJyr//Jk4pqO9ARMSD+IciTZbq lM3XdFLWQ7Gey0JiiU5GS0fjHW3OaPIlZo1VS9CzCAqTlYu9tyWeqYcmJRS07exnSqF0 ggOkUkTR2YEwoMOpRsLMDXWSQ5uDiN9jRyetXVIg8YfbTjw0mt1S2c3mzPEhdUd7hwAv JoskZrF5CtWHYeBCry+UBGAeRHD4HQLKgFIDVIrNjmQj1WrqZVER5TMPTbAAZ200ADIC T/IQ== X-Gm-Message-State: ANoB5pnKCFdEqeIInJo3XgyAIARvCmsfArfaLAia7qzEwQTl/9FGwzci Aw/+mWIYA/ypjDsku7ACWW4= X-Received: by 2002:a63:220c:0:b0:46a:e819:216c with SMTP id i12-20020a63220c000000b0046ae819216cmr14804255pgi.155.1669221045555; Wed, 23 Nov 2022 08:30:45 -0800 (PST) Received: from localhost (fwdproxy-prn-118.fbsv.net. [2a03:2880:ff:76::face:b00c]) by smtp.gmail.com with ESMTPSA id o31-20020a635d5f000000b004769f0fd385sm10979505pgm.52.2022.11.23.08.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 08:30:45 -0800 (PST) From: Nhat Pham To: senozhatsky@chromium.org Cc: hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, minchan@kernel.org, ngupta@vflare.org, akpm@linux-foundation.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH v6 6/6] zsmalloc: Implement writeback mechanism for zsmalloc Date: Wed, 23 Nov 2022 08:30:44 -0800 Message-Id: <20221123163044.2029016-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Thanks for the comments, Sergey! > A nit: we usually call get_first_page() in such cases. I'll use get_first_page() here in v7. > We probably better to cond_resched() somewhere here. Or in zs_zpool_shrink() > loop. I'll put it right after releasing the pool's lock in the retry loop: /* Lock out object allocations and object compaction */ remove_zspage(class, zspage, fullness); spin_unlock(&pool->lock); cond_resched(); /* Lock backing pages into place */ lock_zspage(zspage); This will also appear in v7. In the meantime, please feel free to discuss all the patches - I'll try to batch the changes to minimize the churning.