Re: missing madvise functionality



Ulrich Drepper <drepper@xxxxxxxxxx> writes:

to free: mmap(PROT_NONE) over the area

Why do you need a lock for that? I don't see any problem with
two threads doing that in parallel. The kernel would
serialize it internally and one would fail, but that shouldn't
be a problem.

Of course having the lock should also not make much difference --
if glibc doesn't do it then it kernel would anyways and run
into the same scalability issue on mmap_sem.

-Andi

-
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/



Relevant Pages

  • [patch 00/10] PI-futex: -V1
    ... We are pleased to announce "lightweight userspace priority inheritance" ... No registration, no extra kernel ... only a single owner may own a lock (i.e. no ... Priority Inheritance - why, oh why??? ...
    (Linux-Kernel)
  • Re: CFR: New NFS Lock Manager
    ... It also includes minor fixes to support 64bit architectures and RELENG_7. ... Lock Manager which runs in kernel mode and uses the normal local locking infrastructure for its state. ... A single thread should be sufficient for the NLM since it should rarely block in normal operation. ...
    (freebsd-current)
  • [patch 3/6] lightweight robust futexes: docs
    ... +The robust futex ABI ... for kernel assist of cleanup of held locks on task exit. ... will attempt to process both lists on each task ... pointer to a single linked list of 'lock entries', one per lock, ...
    (Linux-Kernel)
  • Re: [PATCH] [13/16] HWPOISON: The high level memory error handler in the VM v3
    ... And anon_vma lock nests inside i_mmap_lock. ... right now to consume. ... will make the kernel bug. ... for pagecache pages), this may not be able to trigger the race I was ...
    (Linux-Kernel)
  • Re: FreeBSD 7.0 crashed when running super-smack upon PostgreSQL
    ... Is there any chance I can get remote access to a box holding the synchronized kernel, kernel debugging symbols, source code, and core dump? ... It sounds like TCP in a user thread is stumbling over a violation of system invariants (don't sleep while holding a mutex) performed by another thread. ... We need to track down the original thread and figure out why it's sleeping while holding that lock -- perhaps it's a user thread performing a copyin/copyout holding the lock, or perhaps an ithread or other software interrupt thread acquiring a lock of an inappropriate type while holding the lock. ... kgdb has its own thread ID scheme so you'll need to use info threads to track down the right kgdb thread id before you can select the identified kernel thread/process. ...
    (freebsd-stable)