From: Vasiliy Kulikov Date: Wed, 3 Aug 2011 18:28:26 +0000 (+0400) Subject: shm: optimize exit_shm() X-Git-Tag: v3.1-rc1~44 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=298507d4d2cff2248e84afcf646b697301294442;p=pandora-kernel.git shm: optimize exit_shm() We may optimistically check .in_use == 0 without holding the rw_mutex: it's the common case, and if it's zero, there certainly won't be any segments associated with us. After taking the lock, the idr_for_each() will do the right thing, so we could now drop the re-check inside the lock without any real cost. But it won't hurt. Signed-off-by: Vasiliy Kulikov Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed