Re: [PATCH 2/5] Direct Migration V9: migrate_pages() extension

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

 



Christoph Lameter <[email protected]> wrote:
>
> +	for(i = 0; i < 10 && page_mapped(page); i++) {
>  +		int rc = try_to_unmap(page);
>  +
>  +		if (rc == SWAP_SUCCESS)
>  +			break;
>  +		/*
>  +		 * If there are other runnable processes then running
>  +		 * them may make it possible to unmap the page
>  +		 */
>  +		schedule();
>  +	}

The schedule() in state TASK_RUNNING simply won't do anything unless this
process happens to have been preempted.  You'll find that an ndelay(100) is
about as useful.

So I'd suggest that this part needs a bit of a rethink.  If we really need
to run other processes then try a schedule_timeout_uninterruptible(1).  If
not, just remove the loop.

Please stick a printk in there, work out how often and under which
workloads that loop is actually doing something useful.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux