Re: [PATCH] 2/5: Device-mapper: kcopyd

From: Andrew Morton
Date: Wed Jun 02 2004 - 22:43:32 EST


Alasdair G Kergon <agk@xxxxxxxxxx> wrote:
>
> kcopyd

I dunno about the rest of the people around here but I for one do not know
what kcopyd does, nor why it is being added to the kernel. The changelog
was your chance to enlighten us - it is a shame nobody took the five
minutes to prepare a description.


> +static void drop_pages(struct page_list *pl)
> +{
> + struct page_list *next;
> +
> + while (pl) {
> + next = pl->next;
> + free_pl(pl);
> + pl = next;
> + }
> +}

What is the page pool for? It is unfortunate that there is no suitable
library code for managing this - it is a fairly common pattern. Maybe we
could massage mempools in some manner.

Why are the pooled pages locked?

> +static LIST_HEAD(_complete_jobs);
> +static LIST_HEAD(_io_jobs);
> +static LIST_HEAD(_pages_jobs);
> +
> +static int __init jobs_init(void)
> +{
> + INIT_LIST_HEAD(&_complete_jobs);
> + INIT_LIST_HEAD(&_io_jobs);
> + INIT_LIST_HEAD(&_pages_jobs);

Do these lists need to be initialised a second time?

> + memcpy(sub_job, job, sizeof(*job));
> + memcpy(&job->source, from, sizeof(*from));

Structure assignments are nice. If the struct is small the compiler will
do an element-by-element copy. At some compiler-determined breakpoint it
will do a memcpy. And it's typesafe.
-
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/