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 X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F6FDC2B9F4 for ; Thu, 17 Jun 2021 14:37:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC1E3610A1 for ; Thu, 17 Jun 2021 14:37:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC1E3610A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8150B6B0070; Thu, 17 Jun 2021 10:37:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C4256B0071; Thu, 17 Jun 2021 10:37:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63E076B0072; Thu, 17 Jun 2021 10:37:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 3174B6B0070 for ; Thu, 17 Jun 2021 10:37:23 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D2CBA824C437 for ; Thu, 17 Jun 2021 14:37:22 +0000 (UTC) X-FDA: 78263468724.12.1A6A01F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf12.hostedemail.com (Postfix) with ESMTP id 1C38855B for ; Thu, 17 Jun 2021 14:37:06 +0000 (UTC) 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 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1C38855B Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=S7Wo9IO+; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="weKQj/4x"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=S7Wo9IO+; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: d75oo7u9jj7a4zekjehhgbipctm45k5e X-HE-Tag: 1623940626-419161 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.