Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp687680pxj; Thu, 17 Jun 2021 11:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZfdwfw2wCD3Fh5l0DRBl6U0ItYemTof8oczGrpHo4LHY4rNBy0vDcvelqv3B2qPRiSjKn X-Received: by 2002:a6b:8f81:: with SMTP id r123mr4793418iod.154.1623954283279; Thu, 17 Jun 2021 11:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623954283; cv=none; d=google.com; s=arc-20160816; b=TqPRaSSZPKi+iUa48jYmGJYh/WIImQI/prLBj/Lrg9GWg7hN4Ygdpr01qAmAZdIhy8 GCAQfNIvqAzcyBaKtSZhjg0lzP17LTD0WDJtynimDG4NnhgDfhQra+uc+TXPjiQFHA+b Ztv3B8vjxC9cUETKR8cHE89Wecn+rjtFzKJkyEb+5gq7c5eV/gsieypS/QGODF2TzHi7 njMyVczI45jnHXSqPUuTrryu87FL0Pnrmwoo2uSNSL5ewdHaZTZTR5MeVW3fJN8AoNyx vsww9tE7ngSWRoa6yzsRtpfEJrHedNwx1lp5REk/xjkmWRDRAiCUCYiOxdihh23Bft/f v/dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=M+fSxa1wG+88od46CsiBngCtNj3W4t4qd32uH/eMCnU=; b=Ua1hPmnI92wpwG5z2LqjrchJP1hqgbnS3xGepe/YEVnBXXeC6D2Xi59bPndnkK9C19 bpI3/oJlckpYgfpNwKVWVeqfJWkbEOoUS6M5HeZ6EqfszzNbQ69ZABDOplJEZEL9M2Hs lUkV3Ok7SX+vgYTW3vX2zIme9uIWUMzwQ7cL6fil0YcSJ1+8wd0pyvYRKu0+1DS4aQLi XSWRFvPuD7d9UtfigygsI1LF1WOj27cs87MktP79zfuq4ayUu/I6huJYqTOav+C+ZJQ1 WBb7JQLIidw/TNOaOTw4TaLfA5bMd5zl/azBviM9KEoHC/GtlgYicuuOFNOceIEmkagR Vw8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=S7Wo9IO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si6856114jat.111.2021.06.17.11.24.09; Thu, 17 Jun 2021 11:24:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=S7Wo9IO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232926AbhFQOje (ORCPT + 99 others); Thu, 17 Jun 2021 10:39:34 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:48302 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbhFQOj3 (ORCPT ); Thu, 17 Jun 2021 10:39:29 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2072321B0D; Thu, 17 Jun 2021 14:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623940641; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M+fSxa1wG+88od46CsiBngCtNj3W4t4qd32uH/eMCnU=; b=weKQj/4xIvPMP+zMYOKvZZpgRcm9Khkjx3ysroKsxU558oST54zweTWK/lYYRMBzb5cqSW xozR+Ws4SfcfpFigwOSq+yOsMQtKftdtp/BdZLovXhH/wnI+vcXzGcEu7H0GR8AJADC7m3 wRYGlfCRqMl5KCxq/XAjDkUXoESPKzY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623940641; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M+fSxa1wG+88od46CsiBngCtNj3W4t4qd32uH/eMCnU=; b=S7Wo9IO+n3KLaMYkganyy+Hr/Yo+cHuQ4O/9DsDuC8ArqZdq452lq+AeSxFJ+JHhAPlgYk Og7k7wdHkN2MW7Dw== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id D488C118DD; Thu, 17 Jun 2021 14:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623940641; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M+fSxa1wG+88od46CsiBngCtNj3W4t4qd32uH/eMCnU=; b=weKQj/4xIvPMP+zMYOKvZZpgRcm9Khkjx3ysroKsxU558oST54zweTWK/lYYRMBzb5cqSW xozR+Ws4SfcfpFigwOSq+yOsMQtKftdtp/BdZLovXhH/wnI+vcXzGcEu7H0GR8AJADC7m3 wRYGlfCRqMl5KCxq/XAjDkUXoESPKzY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623940641; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M+fSxa1wG+88od46CsiBngCtNj3W4t4qd32uH/eMCnU=; b=S7Wo9IO+n3KLaMYkganyy+Hr/Yo+cHuQ4O/9DsDuC8ArqZdq452lq+AeSxFJ+JHhAPlgYk Og7k7wdHkN2MW7Dw== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id zqwmMyBey2AhaQAALh3uQQ (envelope-from ); Thu, 17 Jun 2021 14:37:20 +0000 Subject: Re: [PATCH v3 1/2] mm: compaction: support triggering of proactive compaction by user To: Charan Teja Kalla , akpm@linux-foundation.org, nigupta@nvidia.com, hannes@cmpxchg.org, corbet@lwn.net, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, aarcange@redhat.com, cl@linux.com, xi.fengfei@h3c.com, mchehab+huawei@kernel.org, andrew.a.klychkov@gmail.com, dave.hansen@linux.intel.com, bhe@redhat.com, iamjoonsoo.kim@lge.com, mateusznosek0@gmail.com, sh_def@163.com, vinmenon@codeaurora.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <7db6a29a64b29d56cde46c713204428a4b95f0ab.1622454385.git.charante@codeaurora.org> <88abfdb6-2c13-b5a6-5b46-742d12d1c910@suse.cz> <0ca491e8-6d3a-6537-dfa0-ece5f3bb6a1e@codeaurora.org> From: Vlastimil Babka Message-ID: <0d516cfa-f41c-5ccc-26aa-67871f23dcd3@suse.cz> Date: Thu, 17 Jun 2021 16:37:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <0ca491e8-6d3a-6537-dfa0-ece5f3bb6a1e@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/21 9:30 AM, Charan Teja Kalla wrote: > Thanks Vlastimil for your inputs!! > > On 6/16/2021 5:29 PM, Vlastimil Babka wrote: >>> This triggering of proactive compaction is done on a write to >>> sysctl.compaction_proactiveness by user. >>> >>> [1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=facdaa917c4d5a376d09d25865f5a863f906234a >>> >>> Signed-off-by: Charan Teja Reddy >>> --- >>> changes in V2: >> You forgot to also summarize the changes. Please do in next version. > > I think we can get rid off 'proactive_defer' thread variable with the > timeout approach you suggested. But it is still requires to have one > additional variable 'proactive_compact_trigger', which main purpose is > to decide if the kcompactd wakeup is for proactive compaction or not. > Please see below code: > if (wait_event_freezable_timeout() && !proactive_compact_trigger) { > // do the non-proactive work > continue > } > // do the proactive work > ................. > > Thus I feel that on writing new proactiveness, it is required to do > wakeup_kcomppactd() + set a flag that this wakeup is for proactive work. > > Am I failed to get your point here? The check whether to do non-proactive work is already guarded by kcompactd_work_requested(), which looks at pgdat->kcompactd_max_order and this is set by wakeup_kcompactd(). So with a plain wakeup where we don't set pgdat->kcompactd_max_order will make it consider proactive work instead and we don't need another trigger variable AFAICS.