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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 9441BC433ED for ; Wed, 19 May 2021 10:20:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 48F0561244 for ; Wed, 19 May 2021 10:20:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48F0561244 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B43196B0036; Wed, 19 May 2021 06:20:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF09A6B006C; Wed, 19 May 2021 06:20:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 943BD6B006E; Wed, 19 May 2021 06:20:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 5DE276B0036 for ; Wed, 19 May 2021 06:20:09 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E45219085 for ; Wed, 19 May 2021 10:20:08 +0000 (UTC) X-FDA: 78157585296.07.1197C93 Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by imf21.hostedemail.com (Postfix) with ESMTP id 53F65E0001B2 for ; Wed, 19 May 2021 10:20:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1621419608; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=Ic8FJNP9L+1A0PI/Lman567/Hir6/FYMQCBLwb1m9Po=; b=sn4+UBLAOdch0WmJnX4tVgrbiQS9omgY6COP6oneb8U3XoXGlVlDRATlBso9A0LCLCrUmkM8 Xv24HULPOZ1420vJA8LSIYmgPtGiw+mzzFav/C+quqnQ3BJgCcMOVB3/6rmrV5F+VnWXpoL4 4g9fG1B0Iwy2X6n87/w1R6Sp5pc= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 60a4e6437b9a7a2b6c3389e5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 19 May 2021 10:19:47 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4DD5AC4338A; Wed, 19 May 2021 10:19:47 +0000 (UTC) Received: from [192.168.29.110] (unknown [49.37.156.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charante) by smtp.codeaurora.org (Postfix) with ESMTPSA id 15BCEC433F1; Wed, 19 May 2021 10:19:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 15BCEC433F1 Subject: =?UTF-8?B?UmU6IOetlOWkjTogW1BBVENIIFYyXSBtbTogY29tcGFjdGlvbjogc3Vw?= =?UTF-8?Q?port_triggering_of_proactive_compaction_by_user?= To: "Chu,Kaiping" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "keescook@chromium.org" , "yzaikin@google.com" , "vbabka@suse.cz" , "nigupta@nvidia.com" , "bhe@redhat.com" , "mateusznosek0@gmail.com" , "sh_def@163.com" , "iamjoonsoo.kim@lge.com" , "vinmenon@codeaurora.org" Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" References: <1621345058-26676-1-git-send-email-charante@codeaurora.org> <79279be3573542dea0266f8e9d4d5368@baidu.com> From: Charan Teja Kalla Message-ID: Date: Wed, 19 May 2021 15:49:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <79279be3573542dea0266f8e9d4d5368@baidu.com> Content-Type: text/plain; charset=gbk Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=mg.codeaurora.org header.s=smtp header.b=sn4+UBLA; dmarc=none; spf=pass (imf21.hostedemail.com: domain of bounce@mg.codeaurora.org designates 69.72.43.7 as permitted sender) smtp.mailfrom=bounce@mg.codeaurora.org X-Stat-Signature: hyjf6x8rfoyghrdz57itcjkj3z4jwdsg X-Rspamd-Queue-Id: 53F65E0001B2 X-Rspamd-Server: rspam02 X-HE-Tag: 1621419606-82273 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: Thanks Kaiping for your review comments!! On 5/19/2021 7:11 AM, Chu,Kaiping wrote: >> This triggering of proactive compaction is done on a write to >> sysctl.compaction_proactiveness by user. > If you want to trigger compaction from userspace, you can use " echo 1 > /proc/sys/vm/compact_memory", there is no need to be so complex. 1) compact_memory is intended for debug interface. And moreover we can't issue the compaction in some controlled manner as write to this node triggers the full node compaction. This patch aims at users who want to do the compaction in some controlled manner from user space. Example user is app launcher preparing the system before launching a memory hungry app. 2) Also, with the current implementation of proactive compaction, say user sets the sysctl.compaction_proactiveness, the values can have effect only in the next HPAGE_FRAG_CHECK_INTERVAL_MSEC(500msec), IOW, the proactive compaction can run with the new settings only after 500msec which can make the user to wait for 500msec after setting a value in the compaction_proactiveness to think that the value written is came into effectiveness. Say user want to launch a gaming application which has higher memory requirements and its launch time is proportional to the available higher order pages. So, what he can do to get the larger number of pages is set the compaction_proactivness to higher value, continue launching the application and once finishes can set the proactivness to original value. But with the current implementation the value set may not come into effectiveness at all because of the 500msec delay.Thus,the patch also handles the scenario of requiring the proactive compaction to run immediately once user sets the 'compaction_proactiveness'. May be I need to update the commit log even more clear about why can't we use the 'compact_memory' and requirements to need to run the proactive compaction immediately once user changes the compaction_proactivness. > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project