mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 1/6] mlock: only hold mmap_sem in shared mode when
@ 2010-12-10 19:00 George Spelvin
  0 siblings, 0 replies; only message in thread
From: George Spelvin @ 2010-12-10 19:00 UTC (permalink / raw)
  To: linux-kernel, peterz; +Cc: linux

How about (bugfixed):

bool cond_break_mutex(struct mutex *mutex)
{
	if (!mutex_is_contended(mutex))
		return false;
	mutex_unlock(mutex);
	mutex_lock(mutex);
	return true;
}

It would be possible to share work between the unlock and lock slowpaths
(particularly the wait_lock acquisition), but that's probably more
maintenance effort than it's worth.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-10 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-10 19:00 [PATCH 1/6] mlock: only hold mmap_sem in shared mode when George Spelvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®