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

From: Andrew Morton
Date: Wed Jan 11 2006 - 00:54:19 EST


Christoph Lameter <clameter@xxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/