From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7F01C433F5 for ; Tue, 11 Jan 2022 23:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3LXRscxgB+MJa3AYeUoA/a9+kUAJfmn+yDqZg6hzu5s=; b=ge6Nez7+alB8BT DRbMzCqFUGIevV7HHx5jC/RUmcRbhghILVoTThUY1XJ9jQjqJtoZKugcaYQ/yS+QXe+u1gO4dyk9Y nCTpNK486ecDDCf86ORvw94JCPxEjb5atia7pSVmqF2Ubsde94kDOoZs+WjnE7Gl53QV2GBTeHU3I CP/bsz8tGxPc1BDQ6icM4w9glPebTKIwIjJ+KstmI0/QekHb5uLxz/GPwUdFwPyLEpdY7ropXoqbr LnKvYkyXaqMKvUSI4m5tl3Uketo5z/ksRUNi1YiitOyaTBqWxnd5KTxK0363AUVNErTQgMZY33qHf sly17sZGiIWAFopT9OXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7QO4-000QqC-W2; Tue, 11 Jan 2022 23:17:09 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7QO0-000Qoc-Qx for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 23:17:06 +0000 Received: by mail-io1-xd2d.google.com with SMTP id p7so1125712iod.2 for ; Tue, 11 Jan 2022 15:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+BNyhiKbMm4RyIg8JNrtqDxZgbHGdo0J7XNrf0piRew=; b=iskzbXe5xMvIxCUIg2oP1wUuouDfhgLnCC+sQJPAAAZEHx/x1j5Al9PEfKyyAXPPL0 8cv4uckuhLYcffGBt04dCVj17g9Bx9b3LLN4XH14iZtpWuxjHsDC+6fM5paFu0GZ7ZOc OPSe0TwDLDOQBnMk5VrrS2x7TJvIhgv9+SOESCKNl0sM50g+kb8sjRU9VXmsCgSlB7Pk Sq0yuZLlWA/XbIf4jLqEv9rrIPGbRiXCNb/WHEkTua98LZ7UGm7jeNIauz9xcODpbM38 ONSBKKdQR8MmmejnouArJBl/1Vl4tiNj2Lkr5VwJyJE0IoBNbgSbtK2hLXLSf3//qmTk nv1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+BNyhiKbMm4RyIg8JNrtqDxZgbHGdo0J7XNrf0piRew=; b=P1gqwtGyCaxCN+9615d9HZOVS5VKJTZna+QKJTWcxZ8kNo9Uct/1QbuVnPk+kUEHv2 cSu9wjHnUfK7EaWXsw2H0X9W5dz5S55y6MYl3uUQpIWvRMY8ZwFyb91UK3LUzD+u53u1 N7ljiJ+nbKgEmSPU992b4zGi0P1O6V8b8L+exo+du41q7BdOf5UeLpzMuqHsvZLi/j1I SH+nbuluCrXLkCertuxubm3BStQqZhGDz/1pAF48H7ZOE3aEoXfNdTXylbg+atNGsQtN 5dspU5KAEiVrH8nxfgeUtjWSyqNey2cJXGgP+lOIG65iv3P3Wlr2WxNSfO6ehXaMpG6z 1cbw== X-Gm-Message-State: AOAM532syoSeIAdB5kWCw7iPnHGK4D/PsBhw7pw/PYyeD/olSFuTPyM5 A984ZWItQxUYQXRXThwF4LJDmw== X-Google-Smtp-Source: ABdhPJyF9jePSeHs9NHaVjjmJYEtoTSK60Y5oIKEaaIgZtxgs/ZSrSvwH+4hyESidsEw5kW2XjQauQ== X-Received: by 2002:a02:aa10:: with SMTP id r16mr3590702jam.36.1641943021690; Tue, 11 Jan 2022 15:17:01 -0800 (PST) Received: from google.com ([2620:15c:183:200:b6b6:70f4:b540:6383]) by smtp.gmail.com with ESMTPSA id o12sm6722264ilu.86.2022.01.11.15.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 15:17:01 -0800 (PST) Date: Tue, 11 Jan 2022 16:16:57 -0700 From: Yu Zhao To: Michal Hocko Cc: Andrew Morton , Linus Torvalds , Andi Kleen , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Konstantin Kharlamov Subject: Re: [PATCH v6 6/9] mm: multigenerational lru: aging Message-ID: References: <20220104202227.2903605-1-yuzhao@google.com> <20220104202227.2903605-7-yuzhao@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_151704_903742_6B8BA15D X-CRM114-Status: GOOD ( 20.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 10, 2022 at 04:01:13PM +0100, Michal Hocko wrote: > On Thu 06-01-22 17:12:18, Michal Hocko wrote: > > On Tue 04-01-22 13:22:25, Yu Zhao wrote: > > > +static struct lru_gen_mm_walk *alloc_mm_walk(void) > > > +{ > > > + if (!current->reclaim_state || !current->reclaim_state->mm_walk) > > > + return kvzalloc(sizeof(struct lru_gen_mm_walk), GFP_KERNEL); > > One thing I have overlooked completely. I appreciate your attention to details but GFP_KERNEL is legit in the reclaim path. It's been used many years in our production, e.g., page reclaim swap_writepage() frontswap_store() zswap_frontswap_store() zswap_entry_cache_alloc(GFP_KERNEL) (And I always test my changes with lockdep, kasan, DEBUG_VM, etc., no warnings ever seen from using GFP_KERNEL in the reclaim path.) > You cannot really use GFP_KERNEL > allocation here because the reclaim context can be constrained (e.g. > GFP_NOFS). This allocation will not do any reclaim as it is PF_MEMALLOC > but I suspect that the lockdep will complain anyway. > > Also kvmalloc is not really great here. a) vmalloc path is never > executed for small objects and b) we do not really want to make a > dependency between vmalloc and the reclaim (by vmalloc -> reclaim -> > vmalloc). > > Even if we rule out vmalloc and look at kmalloc alone. Is this really > safe? I do not see any recursion prevention in the SL.B code. Maybe this > just happens to work but the dependency should be really documented so > that future SL.B changes won't break the whole scheme. Affirmative, as Vlastimil has clarified. Thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel