From patchwork Thu Feb 27 21:07:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0447314BC for ; Thu, 27 Feb 2020 21:18:19 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0CC1246A1 for ; Thu, 27 Feb 2020 21:18:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0CC1246A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 6C8E021FA5C; Thu, 27 Feb 2020 13:18:18 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 8DBDD21F906 for ; Thu, 27 Feb 2020 13:18:15 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 39A6B6C9; Thu, 27 Feb 2020 16:18:13 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 308C846C; Thu, 27 Feb 2020 16:18:13 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:07:50 -0500 Message-Id: <1582838290-17243-3-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 002/622] lustre: osc_cache: remove __might_sleep() X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" The patch 'simplify osc_wake_cache_waiters()' created a new wrapper wait_event_idle_exclusive_timeout_cmd() which includes a __might_sleep() test. This was causing the following back trace: kernel: BUG: sleeping function called from invalid context at fs/lustre/osc/osc_cache.c:1635 kernel: in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 19374, name: cp kernel: INFO: lockdep is turned off. kernel: Preemption disabled at: kernel: [<0000000000000000>] 0x0 kernel: CPU: 11 PID: 19374 Comm: cp Tainted: G W 5.4.0-rc5+ #1 kernel: Call Trace: kernel: dump_stack+0x5e/0x8b kernel: ___might_sleep+0x205/0x260 kernel: osc_queue_async_io+0x1104/0x1de0 [osc] kernel: ? _raw_spin_unlock+0x2e/0x50 kernel: ? libcfs_debug_msg+0x6ab/0xc80 [libcfs] kernel: ? vvp_io_setattr_start+0x200/0x200 [lustre] kernel: osc_page_cache_add+0x2c/0xa0 [osc] kernel: osc_io_commit_async+0x1a8/0x420 [osc] kernel: cl_io_commit_async+0x58/0x80 [obdclass] kernel: ? vvp_io_setattr_start+0x200/0x200 [lustre:1 This can be called from an atomic context and examing the code suggest we don't need __might_sleep() so lets remove it. Fixes: def8e96d4f3d ("lustre: osc_cache: simplify osc_wake_cache_waiters()") Signed-off-by: James Simmons --- fs/lustre/osc/osc_cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c index 3189eb3..2ed7ca2 100644 --- a/fs/lustre/osc/osc_cache.c +++ b/fs/lustre/osc/osc_cache.c @@ -1570,7 +1570,6 @@ static bool osc_enter_cache_try(struct client_obd *cli, cmd1, cmd2) \ ({ \ long __ret = timeout; \ - might_sleep(); \ if (!___wait_cond_timeout(condition)) \ __ret = __wait_event_idle_exclusive_timeout_cmd( \ wq_head, condition, timeout, cmd1, cmd2); \