Re: [PATCH v3] mm,oom: speed up select_bad_process() loop.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri 20-05-16 20:51:56, Tetsuo Handa wrote:
[...]
> +static bool has_pending_victim(struct task_struct *p)
> +{
> +	struct task_struct *t;
> +	bool ret = false;
> +
> +	rcu_read_lock();
> +	for_each_thread(p, t) {
> +		if (test_tsk_thread_flag(t, TIF_MEMDIE)) {
> +			ret = true;
> +			break;
> +		}
> +	}
> +	rcu_read_unlock();
> +	return ret;
> +}

And so you do not speed up anything in the end because you have to
iterate all threads anyway yet you add quite some code on top. No I do
not like it. This is no longer a cleanup...

[...]
> Note that "[PATCH v3] mm,oom: speed up select_bad_process() loop." temporarily
> broke oom_task_origin(task) case, for oom_select_bad_process() might select
> a task without mm because oom_badness() which checks for mm != NULL will not be
> called.

How can we have oom_task_origin without mm? The flag is set explicitly
while doing swapoff resp. writing to ksm. We clear the flag before
exiting.

[...]

> By the way, I noticed that mem_cgroup_out_of_memory() might have a bug about its
> return value. It returns true if hit OOM_SCAN_ABORT after chosen != NULL, false
> if hit OOM_SCAN_ABORT before chosen != NULL. Which is expected return value?

true. Care to send a patch?
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]