search for: irqs_disabled

Displaying 20 results from an estimated 154 matches for "irqs_disabled".

2020 Sep 16
0
[PATCH RFC v1 06/18] x86/hyperv: allocate output arg pages if required
...gt; > - struct page *pg; >> > > + struct page *input_pg; >> > > >> > > input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); >> > > /* hv_cpu_init() can be called with IRQs disabled from hv_resume() */ >> > > - pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); >> > > - if (unlikely(!pg)) >> > > + input_pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); >> > > + if (unlikely(!input_pg)) >> > > return -ENOMEM; >> > > - *input_arg = page_address(pg); >&g...
2020 Sep 15
0
[PATCH RFC v1 06/18] x86/hyperv: allocate output arg pages if required
...vp = &hv_vp_assist_page[smp_processor_id()]; > void **input_arg; > - struct page *pg; > + struct page *input_pg; > > input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); > /* hv_cpu_init() can be called with IRQs disabled from hv_resume() */ > - pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); > - if (unlikely(!pg)) > + input_pg = alloc_page(irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); > + if (unlikely(!input_pg)) > return -ENOMEM; > - *input_arg = page_address(pg); > + *input_arg = page_address(input_pg); > + > + if (hv_root_partit...
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...wait) + +static int __smp_call_function_mask(cpumask_t mask, + void (*func)(void *), void *info, + int wait) { struct call_data_struct data; - int cpus = num_online_cpus() - 1; + cpumask_t allbutself; + int cpus; + + /* Can deadlock when called with interrupts disabled */ + WARN_ON(irqs_disabled()); + + allbutself = cpu_online_map; + cpu_clear(smp_processor_id(), allbutself); + + cpus_and(mask, mask, allbutself); + cpus = cpus_weight(mask); if (!cpus) - return; + return 0; data.func = func; data.info = info; @@ -533,9 +545,12 @@ static void __smp_call_function(void (*f call...
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...wait) + +static int __smp_call_function_mask(cpumask_t mask, + void (*func)(void *), void *info, + int wait) { struct call_data_struct data; - int cpus = num_online_cpus() - 1; + cpumask_t allbutself; + int cpus; + + /* Can deadlock when called with interrupts disabled */ + WARN_ON(irqs_disabled()); + + allbutself = cpu_online_map; + cpu_clear(smp_processor_id(), allbutself); + + cpus_and(mask, mask, allbutself); + cpus = cpus_weight(mask); if (!cpus) - return; + return 0; data.func = func; data.info = info; @@ -533,9 +545,12 @@ static void __smp_call_function(void (*f call...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
..._free_list); + static void free_buf(struct port_buffer *buf) { - kfree(buf->buf); + unsigned long flags; + + if (!buf->dev) { + kfree(buf->buf); + goto freebuf; + } + + BUG_ON(!rproc_enabled); + + /* dma_free_coherent requires interrupts to be enabled */ + if (rproc_enabled && !irqs_disabled()) { + dma_free_coherent(buf->dev, buf->size, buf->buf, buf->dma); + + /* Release device refcnt and allow it to be freed */ + might_sleep(); + put_device(buf->dev); + goto freebuf; + } + + /* queue up dma-buffers to be freed later */ + spin_lock_irqsave(&list_lock, flags); +...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
..._free_list); + static void free_buf(struct port_buffer *buf) { - kfree(buf->buf); + unsigned long flags; + + if (!buf->dev) { + kfree(buf->buf); + goto freebuf; + } + + BUG_ON(!rproc_enabled); + + /* dma_free_coherent requires interrupts to be enabled */ + if (rproc_enabled && !irqs_disabled()) { + dma_free_coherent(buf->dev, buf->size, buf->buf, buf->dma); + + /* Release device refcnt and allow it to be freed */ + might_sleep(); + put_device(buf->dev); + goto freebuf; + } + + /* queue up dma-buffers to be freed later */ + spin_lock_irqsave(&list_lock, flags); +...
2006 Jan 06
2
3ware disk failure -> hang
...R 3w-xxxx[2781]: ERROR: Drive error encountered on port 3 on controller ID:2. Check cables and drives for media errors. (0xa) Jan 6 01:04:10 $SERVER kernel: Debug: sleeping function called from invalid context at include/asm/uaccess.h:556 Jan 6 01:04:10 $SERVER kernel: in_atomic():0[expected: 0], irqs_disabled():1 Jan 6 01:04:10 $SERVER kernel: [<c011fbe9>] __might_sleep+0x7d/0x88 Jan 6 01:04:10 $SERVER kernel: [<f885f056>] tw_ioctl+0x478/0xb07 [3w_xxxx] Jan 6 01:04:10 $SERVER kernel: [<c011fec9>] autoremove_wake_function+0x0/0x2d Jan 6 01:04:10 $SERVER kernel: [<f883f905>...
2020 Nov 03
0
[patch V3 23/37] sched: Make migrate_disable/enable() independent of RT
...task_struct *p, int cpu, int wake_flags) @@ -7883,6 +7875,39 @@ void __cant_sleep(const char *file, int add_taint(TAINT_WARN, LOCKDEP_STILL_OK); } EXPORT_SYMBOL_GPL(__cant_sleep); + +#ifdef CONFIG_SMP +void __cant_migrate(const char *file, int line) +{ + static unsigned long prev_jiffy; + + if (irqs_disabled()) + return; + + if (is_migration_disabled(current)) + return; + + if (!IS_ENABLED(CONFIG_PREEMPT_COUNT)) + return; + + if (preempt_count() > 0) + return; + + if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) + return; + prev_jiffy = jiffies; + + pr_err("BUG: assuming no...
2004 Dec 07
0
Zaptel HDLC (NetHDLC) errors on modprobe, Linux 2.6 kernel
I have my Linux 2.6 kernel with the necessary HDLC config and also recompiled zaptel accordingly. On modprobe, I get: Found a Wildcard: Digium Wildcard T100P T1/PRI Debug: sleeping function called from invalid context at mm/slab.c:2000 in_atomic():0[expected: 0], irqs_disabled():1 [<0211e605>] __might_sleep+0x82/0x8c [<02144643>] kmem_cache_alloc+0x1d/0x57 [<42ad7a2c>] zt_ctl_ioctl+0x112c/0x16b0 [zaptel] [<022d6c00>] __cond_resched+0x14/0x39 [<428a315a>] ext3_get_inode_loc+0x4f/0x210 [ext3] [<0217269c>] d_instantiate+0xa3/0xa9 [...
2006 Feb 09
1
[Bug 445] New: ipt_account reports: sleeping function called from invalid context at mm/slab.c:2063
...rtedBy: jafo@tummy.com The current ipt_account SVN code (and probably earlier, extending back as far as July of 2005) seem to report the following when you read from the /proc/net/ipt_account file: Debug: sleeping function called from invalid context at mm/slab.c:2063 in_atomic():1[expected: 0], irqs_disabled():0 Call Trace:<ffffffff80131dd7>{__might_sleep+173} <ffffffff8015fcab>{kmem_cache_alloc+34} <ffffffffa01b7130>{:ipt_account:account_seq_start+51} <ffffffff80193624>{seq_read+235} <ffffffff801770bf>{vfs_read+207} <ffffffff80177316>{sys_re...
2008 May 08
2
[PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly
...tions(-) Index: kvm/kernel/stop_machine.c =================================================================== --- kvm.orig/kernel/stop_machine.c +++ kvm/kernel/stop_machine.c @@ -62,8 +62,7 @@ static int stopmachine(void *cpu) * help our sisters onto their CPUs. */ if (!prepared && !irqs_disabled) yield(); - else - cpu_relax(); + cpu_relax(); } /* Ack: we are exiting. */ @@ -106,8 +105,10 @@ static int stop_machine(void) } /* Wait for them all to come to life. */ - while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) + while (atomic_read(&stopm...
2008 May 08
2
[PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly
...tions(-) Index: kvm/kernel/stop_machine.c =================================================================== --- kvm.orig/kernel/stop_machine.c +++ kvm/kernel/stop_machine.c @@ -62,8 +62,7 @@ static int stopmachine(void *cpu) * help our sisters onto their CPUs. */ if (!prepared && !irqs_disabled) yield(); - else - cpu_relax(); + cpu_relax(); } /* Ack: we are exiting. */ @@ -106,8 +105,10 @@ static int stop_machine(void) } /* Wait for them all to come to life. */ - while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) + while (atomic_read(&stopm...
2013 Oct 29
3
[PATCH net] virtio-net: correctly handle cpu hotplug notifier during resuming
...ch leads the following warnings: [ 622.944441] CPU0 attaching NULL sched-domain. [ 622.944446] CPU1 attaching NULL sched-domain. [ 622.944485] CPU0 attaching NULL sched-domain. [ 622.950795] BUG: sleeping function called from invalid context at kernel/mutex.c:616 [ 622.950796] in_atomic(): 1, irqs_disabled(): 1, pid: 10, name: migration/1 [ 622.950796] no locks held by migration/1/10. [ 622.950798] CPU: 1 PID: 10 Comm: migration/1 Not tainted 3.12.0-rc5-wl-01249-gb91e82d #317 [ 622.950799] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 622.950802] 0000000000000000 ffff88001d42dba0 ffffffff8...
2013 Oct 29
3
[PATCH net] virtio-net: correctly handle cpu hotplug notifier during resuming
...ch leads the following warnings: [ 622.944441] CPU0 attaching NULL sched-domain. [ 622.944446] CPU1 attaching NULL sched-domain. [ 622.944485] CPU0 attaching NULL sched-domain. [ 622.950795] BUG: sleeping function called from invalid context at kernel/mutex.c:616 [ 622.950796] in_atomic(): 1, irqs_disabled(): 1, pid: 10, name: migration/1 [ 622.950796] no locks held by migration/1/10. [ 622.950798] CPU: 1 PID: 10 Comm: migration/1 Not tainted 3.12.0-rc5-wl-01249-gb91e82d #317 [ 622.950799] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 622.950802] 0000000000000000 ffff88001d42dba0 ffffffff8...
2014 Jul 01
3
[PATCH driver-core-linus] kernfs: kernfs_notify() must be useable from non-sleepable contexts
...xt and in general it's silly to require a sleepable context for triggering a notification. The following is an invalid context bug triggerd by md invoking sysfs_notify() from IO completion path. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1 2 locks held by swapper/1/0: #0: (&(&vblk->vq_lock)->rlock){-.-...}, at: [<ffffffffa0039042>] virtblk_done+0x42/0xe0 [virtio_blk] #1: (&(&bitmap->counts.lock)->rlock){-.....}, at: [<ffffffff81633718>] bitmap_endwrite+0x68/...
2014 Jul 01
3
[PATCH driver-core-linus] kernfs: kernfs_notify() must be useable from non-sleepable contexts
...xt and in general it's silly to require a sleepable context for triggering a notification. The following is an invalid context bug triggerd by md invoking sysfs_notify() from IO completion path. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1 2 locks held by swapper/1/0: #0: (&(&vblk->vq_lock)->rlock){-.-...}, at: [<ffffffffa0039042>] virtblk_done+0x42/0xe0 [virtio_blk] #1: (&(&bitmap->counts.lock)->rlock){-.....}, at: [<ffffffff81633718>] bitmap_endwrite+0x68/...
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> I thought rebasing rproc_serial to linux-next was going to be trivial. But when starting the merge I realized that I had to refactor the the patches from Masami Hiramatsu. The splice support has the same issue as I faced, with different type of buffers in the out_vq. So I ended up refactoring the splice functionality. The code size
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> I thought rebasing rproc_serial to linux-next was going to be trivial. But when starting the merge I realized that I had to refactor the the patches from Masami Hiramatsu. The splice support has the same issue as I faced, with different type of buffers in the out_vq. So I ended up refactoring the splice functionality. The code size
2020 Nov 03
0
[patch V3 19/37] mm/highmem: Remove the old kmap_atomic cruft
...NFIG_HIGHMEM */ - -#if !defined(CONFIG_KMAP_LOCAL) -#if defined(CONFIG_HIGHMEM) - -DECLARE_PER_CPU(int, __kmap_atomic_idx); - -static inline int kmap_atomic_idx_push(void) -{ - int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1; - -#ifdef CONFIG_DEBUG_HIGHMEM - WARN_ON_ONCE(in_irq() && !irqs_disabled()); - BUG_ON(idx >= KM_TYPE_NR); -#endif - return idx; -} - -static inline int kmap_atomic_idx(void) -{ - return __this_cpu_read(__kmap_atomic_idx) - 1; -} -static inline void kmap_atomic_idx_pop(void) -{ -#ifdef CONFIG_DEBUG_HIGHMEM - int idx = __this_cpu_dec_return(__kmap_atomic_idx); - - BU...
2008 Aug 26
0
[PATCH] xen: wrap load_cr3() in manage.c for ia64 support.
...e_suspend(void) { xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index a5bc91a..c7f2953 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -39,8 +39,7 @@ static int xen_suspend(void *data) BUG_ON(!irqs_disabled()); - load_cr3(swapper_pg_dir); - + xen_pre_device_suspend(); err = device_power_down(PMSG_SUSPEND); if (err) { printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n", diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 883a21b..a26db6f 100644 --- a/include/xe...