Re: [discuss] Re: [PATCH] fs/compat.c: rwsem instead of BKL aroundioctl32_hash_table

From: Roland Dreier
Date: Fri Sep 03 2004 - 09:58:44 EST


Andi> The BKL couldn't protect again removal of sleeping compat
Andi> handlers anyways because the BKL is dropped during a
Andi> schedule, and they all can sleep in user accesses. During
Andi> this scheduling window the module could be unloaded if its
Andi> count was zero. But with the assumption above this cannot
Andi> happen.

Andi> So basically the locking there is not to protect against
Andi> running handlers, just to ensure consistency during the list
Andi> walking. The list isn't touched anymore after the compat
Andi> handler runs, so the sleeping in there is no problem.

Andi> RCU could be used as well to protect the list because there
Andi> is no sleep involved.

OK, good point. My logic was wrong when I considered RCU. But now I
don't understand what you meant by "it cannot work" when you wrote
this in your previous email:

Andi> If you wanted to fix it properly better make it use RCU -
Andi> but it cannot work for the case of calling a compat handler.

Based on what you just wrote, it seems to me like RCU would actually
work fine. Is this wrong?

Thanks,
Roland
-
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/