Re: Suspend 2 merge: 36/51: Highlevel I/O routines.

From: Pavel Machek
Date: Fri Nov 26 2004 - 20:20:20 EST


Hi!

> +extern volatile int suspend_io_time[2][2];

Why volatile?

> +
> + PRINTFREEMEM("after initialising page transformers");
> +
> + /* Initialise writer */
> + active_writer->ops.filter.write_init(whichtowrite);
> + PRINTFREEMEM("after initialising writer");
> +
> + get_first_pbe(&pbe, pagedir);
> +
> + /* Write the data */
> + for (i=0; i<size; i++) {
> + int was_mapped = 0;
> + /* Status update */
> + if (!(i&0x1FF))
> + suspend_message(SUSPEND_IO, SUSPEND_LOW, 1, ".");
> + if (((i+base) >= nextupdate) ||
> + (!(i%(1 << (20 - PAGE_SHIFT)))))
> + nextupdate = update_status(i + base, barmax,
> + " %d/%d MB ", MB(base+i+1), MB(barmax));
> + if ((i == (size - 5)) &&
> + TEST_ACTION_STATE(SUSPEND_PAUSE_NEAR_PAGESET_END))
> + check_shift_keys(1, "Five more pages to write.");
> + suspend_message(SUSPEND_IO, SUSPEND_VERBOSE, 1,
> + "Submitting page %d/%d.\n", i, size);
> +
> + /* Write */
> + was_mapped = suspend_map_kernel_page(pbe.address, 1);
> + if (TEST_ACTION_STATE(SUSPEND_TEST_FILTER_SPEED))
> + ret = first_filter->ops.filter.write_chunk(pbe.origaddress);
> + else
> + ret = first_filter->ops.filter.write_chunk(pbe.address);
> + if (!was_mapped)
> + suspend_map_kernel_page(pbe.address, 0);
> +
> + if (ret) {
> + printk("Write chunk returned %d.\n", ret);
> + abort_suspend("Failed to write a chunk of the "
> + "image.");
> + error = -1;
> + goto write_pageset_free_buffers;
> + }

Half of this code seems to be pretty-prints, and performance
metering. That should be gone before mainline merge.

Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
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/