Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1486894
| From | Chen Gang <chengang@emindsoft.com.cn> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions |
| Date | 2016-09-19 23:40 +0200 |
| Message-ID | <sjes9-2tY-21@gated-at.bofh.it> (permalink) |
| References | <siiet-7Y1-1@gated-at.bofh.it> <siq2m-4k3-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions chengang@emindsoft.com.cn - 2016-09-17 09:30 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Michal Hocko <mhocko@kernel.org> - 2016-09-17 17:50 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Chen Gang <chengang@emindsoft.com.cn> - 2016-09-19 23:40 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Michal Hocko <mhocko@kernel.org> - 2016-09-20 10:10 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Chen Gang <chengang@emindsoft.com.cn> - 2016-09-21 00:10 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Michal Hocko <mhocko@kernel.org> - 2016-09-21 10:20 +0200
Re: [PATCH] mm: migrate: Return false instead of -EAGAIN for dummy functions Vlastimil Babka <vbabka@suse.cz> - 2016-09-21 10:20 +0200
csiph-web