Re: [PATCH] Clean up sys_shutdown

From: Andi Kleen
Date: Fri Apr 10 2009 - 04:36:12 EST


On Thu, Apr 09, 2009 at 10:14:16PM -0700, Andrew Morton wrote:
> I wonder why this code uses lock_kernel().

I suspect because there's no other lock and parallel shutdowns
would be bad, but I wouldn't be surprised if there
aren't some caller without.

We could just convert it to a new global mutex or something.
I think it would be safe on x86, but I'm not sure about
all the other architectures.

Actually a simple flag would be enough that returns when
one is already in progress (that wouldn't work if parallel ones
fail, but that's presumably unlikely)

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/