[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121114184929.GA6977@redhat.com>
Date: Wed, 14 Nov 2012 19:49:29 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Ingo Molnar <mingo@...e.hu>, Peter Zijlstra <peterz@...radead.org>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Anton Arapov <anton@...hat.com>, Tejun Heo <tj@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 0/1] uprobes: Use percpu_rw_semaphore to fix
register/unregister vs dup_mmap() race
Hello.
The same patch I sent before, the only difference is that it uses
percpu_rw_semaphore instead of brw_mutex.
Srikar, I'll hope you can ack v2 too, and unless someone objects
I'll ask Ingo to pull this fix.
Tejun, recently we briefly discussed signal->group_rwsem, please
see the note about cgroups below.
Note:
- The current implementation of percpu_rw_semaphore is not
optimal, register/unregister will block fork() completely
while it sleeps in msleep() and synchronize_sched().
So this patch assumes that
percpu_rw_semaphore-reimplement-to-not-block-the-readers-unnecessarily.patch
http://marc.info/?l=linux-mm-commits&m=135240650828875
will be applied eventually (and the new implementation can be
improved).
- This patch adds percpu_down_read/up_read around dup_mmap()
for uprobes.
Given that it is very cheap (and assuming the optimizations
above), _perhaps_ we can turn this dup_mmap_sem into fork_sem
and use it instead of threadgroup_change_begin/end, so that
uprobes and cgroups can use it.
- Compared to v1, percpu_rw_semaphore doesn't support multi-
writers. I hope we can tolerate this, register/unregister
are system-wide and rare events anyway. And _perhaps_ we
can add percpu_down_write_nonexclusive() later.
- Given that currently percpu_down_write() is exclusive, this
patch almost dismisses the purpose of uprobes_mutex[] array.
Yes, but we need to rework this locking anyway for filtering.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists