From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Shi Subject: Re: [V2 PATCH] rt: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 08:17:09 -0700 Message-ID: <527122F5.6030809@windriver.com> References: <1380923937-19506-1-git-send-email-yang.shi@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , To: Thomas Gleixner Return-path: Received: from mail.windriver.com ([147.11.1.11]:63122 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735Ab3J3PRV (ORCPT ); Wed, 30 Oct 2013 11:17:21 -0400 In-Reply-To: Sender: linux-rt-users-owner@vger.kernel.org List-ID: On 10/30/2013 2:22 AM, Thomas Gleixner wrote: > On Fri, 4 Oct 2013, Yang Shi wrote: > >> The following trace is triggered when running ltp oom test cases: >> >> BUG: sleeping function called from invalid context at kernel/rtmutex.c:659 >> in_atomic(): 1, irqs_disabled(): 0, pid: 17188, name: oom03 >> Preemption disabled at:[] mem_cgroup_reclaim+0x90/0xe0 >> >> CPU: 2 PID: 17188 Comm: oom03 Not tainted 3.10.10-rt3 #2 >> Hardware name: Intel Corporation Calpella platform/MATXM-CORE-411-B, BIOS 4.6.3 08/18/2010 >> ffff88007684d730 ffff880070df9b58 ffffffff8169918d ffff880070df9b70 >> ffffffff8106db31 ffff88007688b4a0 ffff880070df9b88 ffffffff8169d9c0 >> ffff88007688b4a0 ffff880070df9bc8 ffffffff81059da1 0000000170df9bb0 >> Call Trace: >> [] dump_stack+0x19/0x1b >> [] __might_sleep+0xf1/0x170 >> [] rt_spin_lock+0x20/0x50 >> [] queue_work_on+0x61/0x100 >> [] drain_all_stock+0xe1/0x1c0 >> [] mem_cgroup_reclaim+0x90/0xe0 >> [] __mem_cgroup_try_charge+0x41a/0xc40 >> [] ? release_pages+0x1b1/0x1f0 >> [] ? sched_exec+0x40/0xb0 >> [] mem_cgroup_charge_common+0x37/0x70 >> [] mem_cgroup_newpage_charge+0x26/0x30 >> [] handle_pte_fault+0x618/0x840 >> [] ? unpin_current_cpu+0x16/0x70 >> [] ? migrate_enable+0xd4/0x200 >> [] handle_mm_fault+0x145/0x1e0 >> [] __do_page_fault+0x1a1/0x4c0 >> [] ? preempt_schedule_irq+0x4b/0x70 >> [] ? retint_kernel+0x37/0x40 >> [] do_page_fault+0xe/0x10 >> [] page_fault+0x22/0x30 >> >> So, to prevent schedule_work_on from being called in preempt disabled context, >> remove the pair of get_cpu/put_cpu and drain_local_stock shortcut. > Simply replace get/put_cpu() with get/put_cpu_light() and the problem is fixed > with 2 lines of change. Thanks tglx. I will submit follow-up patch soon. Yang > > Thanks, > > tglx