Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbcLLWp7 (ORCPT ); Mon, 12 Dec 2016 17:45:59 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:55902 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752075AbcLLWpq (ORCPT ); Mon, 12 Dec 2016 17:45:46 -0500 Date: Mon, 12 Dec 2016 14:45:31 -0800 From: Shaohua Li To: Tejun Heo CC: Michal Hocko , LKML Subject: Re: WARNING: CPU: 3 PID: 1568 at kernel/sched/core.c:7738 __might_sleep+0x69/0x7e Message-ID: <20161212224531.GA28367@shli-mbp.local> References: <20161209151229.GD4334@dhcp22.suse.cz> <20161212220349.GK13864@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161212220349.GK13864@htj.duckdns.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [2620:10d:c090:200::9349] X-ClientProxiedBy: MWHPR18CA0039.namprd18.prod.outlook.com (10.175.9.153) To MWHPR15MB1646.namprd15.prod.outlook.com (10.175.138.23) X-MS-Office365-Filtering-Correlation-Id: dbfb53bf-1f48-44f3-5b15-08d422e098f9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR15MB1646; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1646;3:veKfVtKWzF37hl9FdPjU+ytDPHEbYilDzCeSljvW8J0BMSn/q0cAoUD20sMJTT58zOjB6Pq4ZtGvENQGhjq8jBQzm0gJl8iqwPhgP+HNwHQ5agCPvIV3UlbrhxtD6KplOV7+ZFeaN0yEvnr9aw7aFfXOxuo/oMA/l/0/Z3BZ9q5Bk/FlJrtkchvs5+Rp6Oo59Au/8F3WfNjVsVDQAC3vEXR/3x04pqtAdf+ImDBLpxC0gHxxJedsqD3uwAkWCiVrpbxt1rFYhhNUXx5qoGM7iQ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FwCV7xK/ibanERqaTSy3sfTa542B4bqQ4dkTUvvJowg49wh/MYDpd57p9F1G6SNun1xVX4UzwM+NZHu7wak+KozD42A4geZ00VcPDZZc2a7Y6h2jXgARtxZQ1wyKuKdBhYt97kMU1p1/OiihwmfRaRYRxMMmHIKZRl6FxCTyU3VS/F7NSHC2EpERKnViypdnwHnLsWd+07T5lCpM8F4IuJBOJX9zFDE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42068640409301); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123560025)(20161123558021)(20161123555025)(20161123562025)(20161123564025)(6072148);SRVR:MWHPR15MB1646;BCL:0;PCL:0;RULEID:;SRVR:MWHPR15MB1646; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1646;4:1mtYZCMH6mL3gYNV31lUEKY/jb2/Oum3PfZbcHzpO6+TrEn8NSUw6xZgENEFMShHebkz8BmHjoUzDutBsb0ZxFMkKgVOU0jFRagEh0LO5+eYv3YxWWwG+lU7FHbtx2dS9fa7aaLRoRSDS1yG/5+hPoCcIvpbYVLLEJml6XBha/z+QukCzjLT7nvEDJ65n2ZfXve9DYw6RySBP1LsV03ZwlRXKS4jK2r6gNlhOrmEh/V7MmeJxlTWvgT2bzdwqWrRtO49Tk2pQaiZvLMurm665u4sPSvHPzgeAAEc6HcQ/xA5o9t1+shSUAVa/a97v1J8Atzq0RTnFU84jlTDLC97t0/62ymYu8wd3QE1RYzYJpZfCD4C1aNzvhvMYE1uvAJeyywmDk5pklok7JqXqgMqseAdEdVkqvt/dZhQxSkNHtpfQZgPfmvFMOCVgx69JbC/BBoLv0wzcIqUnNx9e96ShCa+X9IFBTKXGn6TWuHcg80FpmhKwu8Aj0n573adWGR6TAh/XsUXyAKmEr0MNT4c7pL4eKRjDHWSxMJr8yfY8JoxppMW7n9S2axkMeKyAzvuOK3mAPxmAfi4w/rFOSQPx8kL0nZbqTs9GHgDQGk8j45fQ3MWekPXCoAZNO40YQ1J5J/cJ5fZ/V0WnPCT3xt5LQ== X-Forefront-PRVS: 0154C61618 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(979002)(6009001)(7916002)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(24454002)(199003)(189002)(229853002)(97736004)(4001350100001)(86362001)(46406003)(38730400001)(6506006)(105586002)(6116002)(92566002)(83506001)(68736007)(50466002)(47776003)(189998001)(54356999)(7736002)(9686002)(6916009)(110136003)(2950100002)(6666003)(101416001)(106356001)(42186005)(23726003)(76176999)(5660300001)(1076002)(305945005)(50986999)(4326007)(8676002)(2906002)(98436002)(33656002)(81166006)(81156014)(97756001)(18370500001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1646;H:shli-mbp.local;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR15MB1646;23:VHKIthcbKjKjGGPnGHLt5GZcHTHb1p8sqsgYQtw3q?= =?us-ascii?Q?fS2s64gW7WrB7DOtyoHFPa3CiGF8vPXUH8SOAAXJMS9ytak5S0qoFW+s+6gP?= =?us-ascii?Q?nYjCWvenoMAYEkxCuXxnErO4Sdt2fkiQ7VcxjLnNvTHR3KE50m0Cm1ZWl2AG?= =?us-ascii?Q?guU5EXa94s1uh0As+EGoWZ0TzD/0pLncpU4OwxiSrRBW7Qn4t2nVfyDEOqkw?= =?us-ascii?Q?QUVmmB7Y2RFYwFQuM2eUnYZwpgDADp6HQQWLD8fOU6Ac0+Iui9Rl6+50jkaV?= =?us-ascii?Q?HGRS8Qvp9D56e4m1ixPLocwe9q5kA/1z+f8KF/xEn6nGLalGhSI6ELLVIaEN?= =?us-ascii?Q?Gk6mLzgSZ1dVeOBldfYrg0LLxS4VBqYqvOND4TYJW+NdkKRq1cndzhYzrXp0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dYYAwBZ7OqoKT5M0QxnW0jI3EVJI1Mh1?= =?us-ascii?Q?2Ci/RzMsbIRN5MKIAUsolJJPdhMpraMFnAXwpU0C8GT8ne7PxAh1uOlWvah7?= =?us-ascii?Q?yyMvg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1646;6:V6UnPZJeEsOWkrNRyGV27Q10l0wbujtI5NSBCK30yCYN1RUY7yVQlOEswQ5tbTsR080RpALN+PchWrqNm7iWT9IQetb7to7OWlf9ugafUrb53UXz6mL6PUxfMUzPO1UF7+1ZBs7fW8UaV+JAeINXQfwfWrxYVQyP0Amili22TuPvsZFXhWzm5fqDeDO6FUtcZ+n3mhPByKtYPj+ivkDJsu0lybrG8vCuD2NmBGAKpBBmCccUJRVRY7S656nGZ9q0eDIUPsarORPXT1QYEoU4GvbLeyrXgFX+mLpEIbojD7eENWmyAuyvdKy9gZSSoHMA8je1v4pPN/Sh/IPvgdlt+sMys9KtsPhC3KsO9JS1OBr24eGzAnEVIrvsQc++DqfAp2FnY3pnTfwjyNGlaCV/rvQrdiqLCyLwgLEio4LTrqs=;5:YpsTslBJ1ZlljX90nU+Yeafc2y86/fFALjudDbnIQnE/IEPdiTtvst5W9onrICI953PuAOF2Zo7klxMkrxxyTywHYcLzcS2mTRkF6LsyhSlFM/5hc/yBE6SU4fYkLLCTX7Zor73c2p7w33ur6cQN2w==;24:RmXCZNDvWIoY7g1PCtw2CSkUT0hESxpSzVBKnJersSiGxGLCARRHWSpelKapuhiDoXLf3zkAZKKgQOU55xFEYAhLetyHqQtpXtnPDtnAzQ8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1646;7:m40LDR0oteczNzw33VL+R7Iz5RL6cuGTK2YqcrtBa6JhWqSXhpbzSQF2QfjwIaJEg8fcTkl8QMfGovVSiOTVDRcOV3r1wQ2osxBpdDiw1kBnk5skH4gfvazViuVdF/0MBuNX0GvYOLp/WqdhoCOrQAPXnScuFylVG1BD8hZ4FJ7voDZmdUtOPgd38PSeSoCbWbZsznjbGAExULvSP+epExILkzzAPa/KAY5aJc1M0CLk/Tp3My5ncpf6CyaBXKZbCBxEP22lk6gEtZWivpTP+kM7BKrXtSt0pUzJi9HtT2csVtyX8UFRiTVAxjPg3sS6m22MxLO4S1ebDhyvEcDmN30/1ls0IH7fZh26unhIqYxhH0Qx3lRnpI03b4lGAr/M93/xI0shPbhO5Z0tpIpuKIxNeBBIInP16jbPQ91Z1fU9ZhlKRRsDTXSU+JKfMT66Q8qSaDOkhZdcnzUjdhVQLQ==;20:gj7NXPY8Ow3mSNP4fwIK65+3P11+ZpjX8/Upd86xC7JVYIdiYH5p8grIy3dTKiP0bi7yPLqQ19g2I9F3gWO7Xo98ULwzipWkJK5EyeiiyqUwPgNGiUxetntR7dYmlLw6Snv5Fammh7WnFo8+C4XJVGmiG0E4SLm4mTDV9HG9PVQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2016 22:45:39.8878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1646 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-12_15:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3549 Lines: 70 On Mon, Dec 12, 2016 at 05:03:49PM -0500, Tejun Heo wrote: > Hello, Michal. > > On Fri, Dec 09, 2016 at 04:12:29PM +0100, Michal Hocko wrote: > > Hi Tejun, > > I am seeing the following warning during boot in my kvm testing > > environment: > > [ 3.549649] WARNING: CPU: 3 PID: 1568 at kernel/sched/core.c:7738 __might_sleep+0x69/0x7e > > [ 3.551279] do not call blocking ops when !TASK_RUNNING; state=2 set at [] prepare_to_wait+0x65/0xac > > [ 3.553354] Modules linked in: > > [ 3.554032] CPU: 3 PID: 1568 Comm: modprobe Not tainted 4.9.0-rc8-nofstest5-next-20161209-00013-g3134766e941a #1018 > > [ 3.556099] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014 > > [ 3.557330] Call Trace: > > [ 3.557330] dump_stack+0x68/0x92 > > [ 3.557330] __warn+0xc2/0xdd > > [ 3.557330] warn_slowpath_fmt+0x4b/0x53 > > [ 3.557330] ? prepare_to_wait+0x65/0xac > > [ 3.557330] ? prepare_to_wait+0x65/0xac > > [ 3.557330] __might_sleep+0x69/0x7e > > [ 3.557330] do_ide_request+0x47/0x540 > > [ 3.557330] ? __lock_is_held+0x47/0x7a > > [ 3.557330] ? hrtimer_try_to_cancel+0x15f/0x1c6 > > [ 3.557330] ? _raw_spin_unlock_irqrestore+0x4c/0x61 > > [ 3.557330] __blk_run_queue+0x31/0x3a > > [ 3.557330] cfq_insert_request+0x331/0x429 > > [ 3.557330] __elv_add_request+0x2bb/0x346 > > [ 3.557330] blk_flush_plug_list+0x1da/0x21f > > [ 3.557330] ? bit_wait+0x50/0x50 > > [ 3.557330] io_schedule_timeout+0x47/0x102 > > [ 3.557330] bit_wait_io+0x1b/0x5a > > [ 3.557330] __wait_on_bit+0x4d/0x7b > > [ 3.557330] out_of_line_wait_on_bit+0x72/0x7d > > [ 3.557330] ? bit_wait+0x50/0x50 > > [ 3.557330] ? autoremove_wake_function+0x4e/0x4e > > [ 3.557330] __wait_on_buffer+0x40/0x43 > > [ 3.557330] bh_submit_read+0x60/0x72 > > [ 3.557330] ext4_get_branch+0x91/0x115 > > [ 3.557330] ext4_ind_map_blocks+0x181/0xa16 > > [ 3.557330] ? __lock_is_held+0x47/0x7a > > [ 3.557330] ? lock_acquire+0x133/0x1c7 > > [ 3.557330] ext4_map_blocks+0x120/0x4ca > > [ 3.557330] ext4_mpage_readpages+0x2a7/0x70a > > [ 3.557330] ext4_readpages+0x33/0x35 > > [ 3.557330] __do_page_cache_readahead+0x239/0x32a > > [ 3.557330] filemap_fault+0x180/0x602 > > [ 3.557330] ? filemap_fault+0x180/0x602 > > [ 3.557330] ext4_filemap_fault+0x37/0x4b > > [ 3.557330] __do_fault+0x1f/0x94 > > [ 3.557330] handle_mm_fault+0x946/0xfca > > [ 3.557330] __do_page_fault+0x361/0x518 > > [ 3.557330] do_page_fault+0x42/0x5f > > [ 3.557330] page_fault+0x22/0x30 > > > > At first I thought this would be related to you recent work > > http://lkml.kernel.org/r/1477673892-28940-1-git-send-email-tj@kernel.org > > but that doesn't seem to be in the linux-next I am using as a base. > > io_schedule_timeout is on the stack though so you might have an idea > > what is going on here. That might_sleep check has been added a long ago > > 02e7cf8f8488 ("ide-cd,atapi: use bio for internal commands") in 2.6.31 > > so I am wondering what has changed since than. > > 10d784eae2b4 ("sched: always use blk_schedule_flush_plug in > io_schedule_out") seems related. might_sleep is complaining that it's > being called while !TASK_RUNNING. Shaohua, any ideas? I can't see how the patch is related. Both blk_flush_plug and blk_schedule_flush_plug can sleep. The patch should only change behavior for plug which accepts from_schedule, which IIRC only raid code uses it. Thanks, Shaohua