From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933120AbcISVjq (ORCPT ); Mon, 19 Sep 2016 17:39:46 -0400 Received: from out1134-194.mail.aliyun.com ([42.120.134.194]:7270 "EHLO out1134-194.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932199AbcISVjo (ORCPT ); Mon, 19 Sep 2016 17:39:44 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07594878|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03278;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_---.6zke1xG_1474321163; Message-ID: <57E05CD2.5090408@emindsoft.com.cn> Date: Tue, 20 Sep 2016 05:46:58 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Michal Hocko CC: akpm@linux-foundation.org, minchan@kernel.org, vbabka@suse.cz, mgorman@techsingularity.net, gi-oh.kim@profitbricks.com, opensource.ganesh@gmail.com, hughd@google.com, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chen Gang Subject: Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions References: <1474096836-31045-1-git-send-email-chengang@emindsoft.com.cn> <20160917154659.GA29145@dhcp22.suse.cz> In-Reply-To: <20160917154659.GA29145@dhcp22.suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/17/16 23:46, Michal Hocko wrote: > On Sat 17-09-16 15:20:36, chengang@emindsoft.com.cn wrote: > >> Also change their related pure Boolean function numamigrate_isolate_page. > > this is not true. Just look at the current usage > > migrated = migrate_misplaced_page(page, vma, target_nid); > if (migrated) { > page_nid = target_nid; > flags |= TNF_MIGRATED; > } else > flags |= TNF_MIGRATE_FAIL; > > and now take your change which changes -EAGAIN into false. See the > difference? Now I didn't even try to understand why > CONFIG_NUMA_BALANCING=n pretends a success but then in order to keep the > current semantic your patch should return true in that path. So NAK from > me until you either explain why this is OK or change it. > For me, it really need return false: - For real implementation, when do nothing, it will return false. - I assume that the input page already is in a node (although maybe my assumption incorrect), and migrate to the same node. When the real implementation fails (e.g. -EAGAIN 10 times), it still returns false. - Original dummy implementation always return -EAGAIN, And -EAGAIN in real implementation will trigger returning false, after 10 times. - After grep TNF_MIGRATE_FAIL and TNF_MIGRATED, we only use them in task_numa_fault in kernel/sched/fair.c for numa_pages_migrated and numa_faults_locality, I guess they are only used for statistics. So for me the dummy implementation need return false instead of -EAGAIN. > But to be honest I am not keen of this int -> bool changes much. > Especially if they are bringing a risk of subtle behavior change like > this patch. And without a good changelog explaining why this makes > sense. > If our original implementation already used bool, our this issue (return -EAGAIN) would be avoided (compiler would help us to find this issue). Thanks. -- Chen Gang (陈刚) Managing Natural Environments is the Duty of Human Beings.