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 DFCEAC05027 for ; Tue, 14 Feb 2023 06:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231708AbjBNGuC (ORCPT ); Tue, 14 Feb 2023 01:50:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbjBNGuA (ORCPT ); Tue, 14 Feb 2023 01:50:00 -0500 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD381D907; Mon, 13 Feb 2023 22:49:54 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R411e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Vbeknu._1676357391; Received: from 30.97.48.79(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Vbeknu._1676357391) by smtp.aliyun-inc.com; Tue, 14 Feb 2023 14:49:52 +0800 Message-ID: Date: Tue, 14 Feb 2023 14:49:51 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 0/3] Some cleanups for page isolation To: Matthew Wilcox Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org, sj@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, damon@lists.linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/14/2023 12:50 PM, Matthew Wilcox wrote: > On Tue, Feb 14, 2023 at 11:18:05AM +0800, Baolin Wang wrote: >> The page isolation functions did not return a boolean to indicate >> success or not, instead it will return a negative error when failed >> to isolate a page. So it's better to check the negative error explicitly >> for isolation to make the code more clear per Linus's suggestion in [1]. > > Only one caller of isolate_lru_page() or folio_isolate_lru() actually > uses the errno. And the errno can only be 0 or -EBUSY. It'd be > better to change the three functions to return bool and fix > add_page_for_migration() to set the errno to -EBUSY itself. Sounds reasonable to me, and I can change them to return bool in next version. Thanks.