On Fri, May 02, 2008 at 02:59:29PM +0200, Peter Zijlstra wrote:OK, so one approach would be to check for irqs being disabled, perhaps as follows, on top of my previous patch: struct call_single_data *data = NULL; if (!wait) { data = kmalloc(sizeof(*data), GFP_ATOMIC); if (data) data->flags = CSD_FLAG_ALLOC; } if (!data) { if (unlikely(irqs_disabled())) { put_cpu(); return -ENOMEM; } data = &d; data->flags = CSD_FLAG_WAIT; } data->func = func; data->info = info; generic_exec_single(cpu, data); That would prevent -ENOMEM unless you invoked the function with irqs disabled. So normal callers would still see the current failure-free semantics -- you really don't want to be inflicting failure when not necessary, right? There could only be one irq-disabled caller at a time, which could be handled using a trylock, returning -EBUSY if the lock is already held. Otherwise, you end up with the scenario called out above (which Keith Ownens pointed out some years ago). Does this approach make sense? Thanx, Paul --
| Andrea Arcangeli | [PATCH 00 of 12] mmu notifier #v13 |
| David Newall | Re: What still uses the block layer? |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Konrad Rzeszutek | [PATCH] Add iSCSI iBFT support (v0.4.5) |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Stefan Richter | Re: [GIT]: Networking |
| Antonio Almeida | HTB accuracy for high speed |
