Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3425233rwi; Tue, 1 Nov 2022 21:27:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wha+3F/f0gS9CB5jYK3Qxk+/F2frpvl9+MFXSnHUC4hZgHTLGy15Er52rWyeJ1YfRBnT7 X-Received: by 2002:a50:fe85:0:b0:458:5562:bf1e with SMTP id d5-20020a50fe85000000b004585562bf1emr21739603edt.167.1667363274057; Tue, 01 Nov 2022 21:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667363274; cv=none; d=google.com; s=arc-20160816; b=uG1IiBVA3s1iwySOLTpIWn75QDzFn9JEdJdmfafj3gXCrjvfks98hdRSdVuhtvBr8X pi4TODcvbXUSR9W9XTqf43hlcg61mYqQd7xLsxYgnWdx3oibti1ip8rDDoGevcy4tQ5F c6WW5EIr1z6A/RDyejvJiabvCo6PncgVMCfRxr3i5qnW58NwJKMiUGHIpHJtwD8JwUmt nj40FDTMug18YyPDLtYaBLT//f+m+kpkfdJLGz0t+HDv4/9/AWNt8iYqgV12/ydcrWWs wdfE47YkM5jPMQ5bvHRtf42WqESXuTqtDPAL3gOR7O7qM96N8jJUzaw0JP9ZmLpvGgXj KrWA== 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=Oo23rdptXeonGeV+R+rAP3rUmFYr9yR6UUbFic0TMHM=; b=JyEma+uqum74Dg1PT/irNKzNJ3C8xlZ09jy1ReGzir9Gk33G88jbvRRndaK4HZ+CAm sPLGjC7Lgsoeiz4GEerL7jbuhy2nj+bqp8ahSvJLnKC2/GHBa0b5huyK3cONICPDQ1gB +uV9JbUcJvMDEQ0KhtVEx4HPLDiDI2LOcyCgQpQrSd55o/lNgCSTD/th4uU4KZBX7go8 CXZE/dxHEOgsaEM9snbt1p0ccclcehp1AjC1bZTPHhD6tRvh2IRrdLqn4V4Go98XtQ8k 0SAOJAKj1aqfAvhMrmqjystUDw23EwZ2QpLQ8tXBW2oYNMf+1PEHLIj/vvmJvIcpmwL4 9ZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ej7aSHjt; 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 o21-20020a170906975500b007adf558e182si3959723ejy.926.2022.11.01.21.27.31; Tue, 01 Nov 2022 21:27:54 -0700 (PDT) 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=Ej7aSHjt; 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 S230122AbiKBDmX (ORCPT + 96 others); Tue, 1 Nov 2022 23:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbiKBDmO (ORCPT ); Tue, 1 Nov 2022 23:42:14 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7152926ADB for ; Tue, 1 Nov 2022 20:42:12 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id q9so198395pfg.5 for ; Tue, 01 Nov 2022 20:42:12 -0700 (PDT) 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=Oo23rdptXeonGeV+R+rAP3rUmFYr9yR6UUbFic0TMHM=; b=Ej7aSHjtyIcfBIc+mXwGkpDPO/8iWJd7WvOMKVWE7hrCgZlw4b1fV14PjOH/sqi9Ky wnr7vwVt2ZDmK1TGnqgdOOQ4GN1Fmd/cv1wdliqW+KcABkCoMKjLQ3g7x01FizZH6HD3 5x/CFyTc7nUU+7RAJG0dswlsWc9Z+xc3laUiU= 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=Oo23rdptXeonGeV+R+rAP3rUmFYr9yR6UUbFic0TMHM=; b=Y342bTdrPkDfw5O911UljnVREuOT9BEVHJBwJeosTz8NVu3KNWJ6pX822M2rIR6/16 79KaLCHHum5DdOEOA3h3WZO3/edbUe+UP5NUB3FjmvlE3tSFhwiH2D+daKdUhdkbVbTf QVT0l0w2/4OhyYA+/eEroHP1xxQadWQxOCGOj28ehmvGcloKEZUK7Y8XTNRtRKd/dAL5 xwL+9sIYpSr9Kf6huCZkmOm1svoF7f1v6sdKYzqvaPKDMzG7IC3W43SZ6bxwg3mfBBeb vQbfu9h0oSdPuFlqYMfLAF0+33M65jvYxHcW3Xs5jLwKvwDb2ydn2GDenq1zdWO+G73B bZbQ== X-Gm-Message-State: ACrzQf0rMWjG9H0t9FCSZk8TU5wlgqw+se7l7Jrt3kHq1rGv1aJOp8Hh hZ3wQIu1MY6JefcFKa/LIjlWzA== X-Received: by 2002:a63:501f:0:b0:46f:a711:c455 with SMTP id e31-20020a63501f000000b0046fa711c455mr15000744pgb.402.1667360532351; Tue, 01 Nov 2022 20:42:12 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f558:dfb0:7cb7:44d9]) by smtp.gmail.com with ESMTPSA id r1-20020a17090a1bc100b0020dda7efe61sm318368pjr.5.2022.11.01.20.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 20:42:11 -0700 (PDT) Date: Wed, 2 Nov 2022 12:42:06 +0900 From: Sergey Senozhatsky To: Nhat Pham Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH v2 5/5] zsmalloc: Implement writeback mechanism for zsmalloc Message-ID: References: <202210272158.7swYwd23-lkp@intel.com> <20221027182736.513530-1-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221027182736.513530-1-nphamcs@gmail.com> X-Spam-Status: No, score=-3.2 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/10/27 11:27), Nhat Pham wrote: [..] > +static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries) > +{ > + int i, obj_idx, ret = 0; > + unsigned long handle; > + struct zspage *zspage; > + struct page *page; > + enum fullness_group fullness; > + > + /* Lock LRU and fullness list */ > + spin_lock(&pool->lock); > + if (!pool->ops || !pool->ops->evict || list_empty(&pool->lru) || > + retries == 0) { > + spin_unlock(&pool->lock); > + return -EINVAL; > + } > + > + for (i = 0; i < retries; i++) { > + struct size_class *class; > + > + zspage = list_last_entry(&pool->lru, struct zspage, lru); > + list_del(&zspage->lru); > + > + /* zs_free may free objects, but not the zspage and handles */ > + zspage->under_reclaim = true; > + > + /* Lock backing pages into place */ > + lock_zspage(zspage); Does this call into the scheduler under pool->lock spinlock?