Re: [PATCH 1/5] Move sleeping operations to outside the semaphore.

From: Serge E. Hallyn
Date: Tue Jun 02 2009 - 10:37:54 EST


Quoting Tetsuo Handa (penguin-kernel@xxxxxxxxxxxxxxxxxxx):
> TOMOYO is using rw_semaphore for protecting list elements.
> But TOMOYO is doing operations which might sleep inside down_write().
> This patch makes TOMOYO's sleeping operations go outside down_write().
>
> Signed-off-by: Kentaro Takeda <takedakn@xxxxxxxxxxxxx>
> Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Toshiharu Harada <haradats@xxxxxxxxxxxxx>

The overall approach (repeated in each stanza) seems safe enough.
Since there are 3 signed-off-by's, I'll assume you've each studied
each one to make sure there are no little little oopses (i.e.
kfreeing the wrong thing or leaking). So how about for now I'll
give

Acked-by: Serge Hallyn <serue@xxxxxxxxxx>

and when you send a patch with more documentation on Tomoyo, I
will start looking through the locking in more detail and try
to send some patches to standardize it.

Part of why I want to ack this one is it switches to at least
normal kmallocs. Frankly I'd prefer to skip the rest of the
patchset for now. Patch 2's been nacked, patch 3 is a lot of
churn for little gain - when a far better patch woudl be one
switching to seq_files. Patch 4 could in fact be a useful step,
I think. Patch 5 adds a whole slew of lists that I still don't
like - I'd rather just see a simple patch that adds refcounting
and doesn't do GC yet.

I personally think trying to add GC before standardizing the
locking and refcounting is a bad bad idea.

thanks,
-serge
--
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/