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 40029C678D5 for ; Wed, 8 Mar 2023 22:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjCHWXY (ORCPT ); Wed, 8 Mar 2023 17:23:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbjCHWXR (ORCPT ); Wed, 8 Mar 2023 17:23:17 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0DB45709B; Wed, 8 Mar 2023 14:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=R4qQSPrsrxUiF/LJLwzutyWNWtqvwbqt9ycagzE4dZQ=; b=WpHJJcvB82hSQFBxW2dUBjILSg xWKBDo52IxNzYVR8UxlzdFs1AX5W3i7+KKQgVUYNhZdb8E/cbEEPRjdtYj7pAVUCH22rs58crVnnw 58pIGfnUH7p/ZVXxJUxXKnWIXVN/A/eof+fzQfAi8Coo1I1yICPSB8WHrwTFZ5C5aAL8Ie3184eQ+ axjXHq6rLEVpG2YgxUW1eyoL+o6PY9I9114cnaAukCTtHkbMdj0V0SBas/RqNQ3Bx/Tidd4hGD7WX 0EyyeIRrrrrz4ACT9N2QvjVG4uLmRk2doE9emiWOkxqUI0EEcQNtr7VCw6fLq0EgY/MwU3D3nFM4X W2DwxJGg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa2Bf-006xGf-CU; Wed, 08 Mar 2023 22:23:07 +0000 Date: Wed, 8 Mar 2023 14:23:07 -0800 From: Luis Chamberlain To: Vlastimil Babka Cc: ye.xingchen@zte.com.cn, keescook@chromium.org, yzaikin@google.com, akpm@linux-foundation.org, linmiaohe@huawei.com, chi.minghao@zte.com.cn, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH V2 2/2] mm: compaction: Limit the value of interface compact_memory Message-ID: References: <202303061405242788477@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 08, 2023 at 10:54:31PM +0100, Vlastimil Babka wrote: > On 3/8/23 20:57, Luis Chamberlain wrote: > > On Wed, Mar 08, 2023 at 11:23:45AM +0100, Vlastimil Babka wrote: > >> > { > >> > - if (write) > >> > + int ret; > >> > + > >> > + ret = proc_dointvec_minmax(table, write, buffer, length, ppos); > >> > + if (ret) > >> > + return ret; > >> > + if (write) { > >> > + pr_info("compact_nodes start\n"); > >> > compact_nodes(); > >> > + pr_info("compact_nodes end\n"); > >> > >> I'm not sure we want to start spamming the dmesg. This would make sense > >> if we wanted to deprecate the sysctl and start hunting for remaining > >> callers to be fixed. Otherwise ftrace can be used to capture e.g. the time. > > > > Without that print, I don't think a custom proc handler is needed too, > > right? So what would simplify the code. > > But we'd still call compact_nodes(), so that's not possible without a custom > handler, no? Ah right. It does beg the question if that form is common, so to define one. But that's just extra work not needed now. Luis