[PATCH] mm: Remove pointless might_sleep() in remove_vm_area().

Matthew Wilcox willy at infradead.org
Mon Mar 27 14:06:10 UTC 2017


On Mon, Mar 27, 2017 at 04:26:02PM +0300, Andrey Ryabinin wrote:
> [+CC drm folks, see the following threads:
> 	http://lkml.kernel.org/r/201703232349.BGB95898.QHLVFFOMtFOOJS@I-love.SAKURA.ne.jp
> 	http://lkml.kernel.org/r/1490352808-7187-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
> ]
> 
> On 03/24/2017 07:17 PM, Matthew Wilcox wrote:
> > On Fri, Mar 24, 2017 at 06:05:45PM +0300, Andrey Ryabinin wrote:
> >> Just fix the drm code. There is zero point in releasing memory under spinlock.
> > 
> > I disagree.  The spinlock has to be held while deleting from the hash
> > table. 
> 
> And what makes you think so?

The bad naming of the function.  If somebody has a function called
'hashtable_remove' I naturally think it means "remove something from
the hash table".  This function should be called drm_ht_destroy().
And then, yes, it becomes obvious that there is no need to protect
destuction against usage because if anyone is still using the hashtable,
they're about to get a NULL pointer dereference.



More information about the dri-devel mailing list