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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B77C433EF for ; Tue, 1 Mar 2022 06:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232323AbiCAGT0 (ORCPT ); Tue, 1 Mar 2022 01:19:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230488AbiCAGTY (ORCPT ); Tue, 1 Mar 2022 01:19:24 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEE61433AB for ; Mon, 28 Feb 2022 22:18:43 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 339B61F37D; Tue, 1 Mar 2022 06:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646115522; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VYJHUH0IgdfnLKYKC3tcsTkSw2HdASrxxZkAzWZIFtM=; b=AAxssDfaKg+Vh+dvy85Lm9NNR4J8ET0z2mgaPAnINymAiB3UiSwmszyLlDz8m4mz1qbTF+ Jaw0VeJixqh0rg8L2VgliVxFCC4dZLfiBoGtBbQZQFZXInwryTKBKmGW3smqWg9H/cuhzy 9tPShcFvBgQsWBIqMAO+7hv/zMCCwG0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646115522; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VYJHUH0IgdfnLKYKC3tcsTkSw2HdASrxxZkAzWZIFtM=; b=boAWlaocpff9pi8AIuLcWTsCXT+E901Zq6CIQqYaC+hbJYB0BFi2eQCyV19LphSjJGjs84 +duKdRJk1VaQp2AA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DEF1F139EF; Tue, 1 Mar 2022 06:18:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CuodMsC6HWLvEwAAMHmgww (envelope-from ); Tue, 01 Mar 2022 06:18:40 +0000 Date: Tue, 1 Mar 2022 07:18:39 +0100 From: Oscar Salvador To: "Huang, Ying" Cc: Peter Zijlstra , Mel Gorman , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Feng Tang , Baolin Wang , Michal Hocko , Rik van Riel , Dave Hansen , Yang Shi , Zi Yan , Wei Xu , Shakeel Butt , zhongjiang-ali , Randy Dunlap , Johannes Weiner Subject: Re: [PATCH -V13 2/3] NUMA balancing: optimize page placement for memory tiering system Message-ID: References: <20220221084529.1052339-1-ying.huang@intel.com> <20220221084529.1052339-3-ying.huang@intel.com> <87czj6321p.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87czj6321p.fsf@yhuang6-desk2.ccr.corp.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 09:16:18AM +0800, Huang, Ying wrote: > Hi, Oscar, Hi Huang Ying > b. Make kswapd of the fast memory node to reclaim pages until the free > pages are a little more than the high watermark (named as promo > watermark). If we want to promote some hot pages from the slow > memory to the fast memory, but the free pages of the fast memory > node will become lower than the high watermark after promotion, we > will wake up kswapd of the fast memory node to demote more cold > pages in the fast memory node to the slow memory node firstly. This > will free some extra space in the fast memory node, so the hot pages > in the slow memory node can be promoted to the fast memory node. What about this? Somehow it sounds clear to me. "b. Define a new watermark called wmark_promo which is higher than wmark_high, and have kswapd reclaiming pages until free pages reach such watermark. The scenario is as follows: when we want to promote hot-pages from a slow memory to a fast memory, but fast memory's free pages would go lower than high watermark with such promotion, we wake up kswapd with wmark_promo watermark in order to demote cold pages and free us up some space. So, next time we want to promote hot-pages we might have a chance of doing so." But I am fine with your updated write up as well, so if you spin a new version: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs