From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07E85C43381 for ; Mon, 18 Mar 2019 02:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC4FD20872 for ; Mon, 18 Mar 2019 02:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727693AbfCRCNW (ORCPT ); Sun, 17 Mar 2019 22:13:22 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:37968 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726798AbfCRCNV (ORCPT ); Sun, 17 Mar 2019 22:13:21 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B6E086946B95840C0EBF; Mon, 18 Mar 2019 10:13:17 +0800 (CST) Received: from linux-work.huawei.com (10.67.189.231) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Mon, 18 Mar 2019 10:13:11 +0800 From: To: CC: , , , chen jie Subject: [PATCH] splice: sendfile() softlockup for big files Date: Mon, 18 Mar 2019 02:02:15 +0000 Message-ID: <1552874535-15679-1-git-send-email-chenjie6@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.231] X-CFilter-Loop: Reflected Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: chen jie sendfile() softlockup for big files [34922.213193] [Softlockup Clock][34922213187422] [34922.213204] BUG: soft lockup - CPU#1 stuck for 60008ms! [trinity-c1:20239] [34922.213211] Modules linked in: rtos_snapshot(O) rsm(O) nfsv3 veth(O) higmac(O) comm(O) nand mtdblock mtd_blkdevs nand_ecc nand_ids pramdisk(O) rtos_kbox_panic(O) double_cluster(O) uart_suspend(O) cache_ops(O) nfsd nfs_acl exportfs auth_rpcgss nfs lockd sunrpc oid_registry grace physmap cfi_probe cfi_cmdset_0002 cfi_util mtd gen_probe chipreg ohci_platform ehci_platform ohci_hcd ehci_hcd usb_device_hisi(O) vfat fat sd_mod enable_uart_rx(O) [last unloaded: rtos_snapshot] [34922.213476] CPU: 1 PID: 20239 Comm: trinity-c1 Tainted: G W O 4.1.12 #12 [34922.213484] Hardware name: Hisilicon A9 [34922.213495] task: ef16b2a0 ti: ede92000 task.ti: ede92000 [34922.213512] PC is at eventfd_write+0x250/0x26c [34922.213528] LR is at sched_clock+0x84/0xa4 [34922.213540] pc : [] lr : [] psr: 20000213 sp : ede93d18 ip : 0000000a fp : c050ab90 [34922.213550] r10: 00000008 r9 : c2d432a0 r8 : 00000ce0 [34922.213559] r7 : 00000008 r6 : c35b4700 r5 : 00000000 r4 : 00000000 [34922.213569] r3 : 00000000 r2 : 00000000 r1 : 000010c4 r0 : 00000000 [34922.213581] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [34922.213591] Control: 1ac5387d Table: aecc004a DAC: 55555555 [34922.213604] CPU: 1 PID: 20239 Comm: trinity-c1 Tainted: G W O 4.1.12 #12 [34922.213612] Hardware name: Hisilicon A9 [34922.213639] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [34922.213664] [] (show_stack) from [] (dump_stack+0xa4/0xdc) [34922.213695] [] (dump_stack) from [] (watchdog_timer_fn+0x33c/0x42c) [34922.213715] [] (watchdog_timer_fn) from [] (hrtimer_run_queues+0x1d0/0x3a8) [34922.213732] [] (hrtimer_run_queues) from [] (run_local_timers+0x8/0x14) [34922.213748] [] (run_local_timers) from [] (update_process_times+0x28/0x5c) [34922.213764] [] (update_process_times) from [] (tick_periodic+0xac/0xcc) [34922.213780] [] (tick_periodic) from [] (tick_handle_periodic+0x24/0x80) [34922.213797] [] (tick_handle_periodic) from [] (twd_handler+0x30/0x44) [34922.213824] [] (twd_handler) from [] (handle_percpu_devid_irq+0xb4/0x1b0) [34922.213842] [] (handle_percpu_devid_irq) from [] (generic_handle_irq+0x20/0x30) [34922.213859] [] (generic_handle_irq) from [] (__handle_domain_irq+0xd8/0x160) [34922.213876] [] (__handle_domain_irq) from [] (gic_handle_irq+0x40/0x6c) [34922.213894] [] (gic_handle_irq) from [] (__irq_svc+0x44/0x5c) [34922.213904] Exception stack(0xede93cd0 to 0xede93d18) [34922.213916] 3cc0: 00000000 000010c4 00000000 00000000 [34922.213930] 3ce0: 00000000 00000000 c35b4700 00000008 00000ce0 c2d432a0 00000008 c050ab90 [34922.213943] 3d00: 0000000a ede93d18 c017afc8 c0258ed8 20000213 ffffffff [34922.213958] [] (__irq_svc) from [] (eventfd_write+0x250/0x26c) [34922.213980] [] (eventfd_write) from [] (__vfs_write+0x2c/0xe8) [34922.213996] [] (__vfs_write) from [] (__kernel_write+0x3c/0xf0) [34922.214016] [] (__kernel_write) from [] (write_pipe_buf+0x38/0x4c) [34922.214032] [] (write_pipe_buf) from [] (__splice_from_pipe+0x138/0x280) [34922.214049] [] (__splice_from_pipe) from [] (splice_from_pipe+0x58/0x70) [34922.214065] [] (splice_from_pipe) from [] (default_file_splice_write+0x1c/0x3c) [34922.214082] [] (default_file_splice_write) from [] (direct_splice_actor+0x34/0x3c) [34922.214098] [] (direct_splice_actor) from [] (splice_direct_to_actor+0x15c/0x278) [34922.214113] [] (splice_direct_to_actor) from [] (do_splice_direct+0x90/0xb8) [34922.214130] [] (do_splice_direct) from [] (do_sendfile+0x188/0x354) [34922.214148] [] (do_sendfile) from [] (SyS_sendfile64+0xcc/0xdc) [34922.214172] [] (SyS_sendfile64) from [] (__sys_trace_return+0x0/0x14) [34922.214182] =====================SOFTLOCKUP INFO BEGIN======================= [34922.214191] ------------------CPU#1----------------------------------- [34922.214200] [CPU#1] the task [trinity-c1] is not waiting for a lock,maybe a delay or deadcircle! [34922.214209] trinity-c1 R running 0 20239 19220 0x00000203 [34922.214241] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [34922.214257] [] (show_stack) from [] (show_lock_info+0xd0/0x29c) [34922.214276] [] (show_lock_info) from [] (watchdog_timer_fn+0x370/0x42c) [34922.214294] [] (watchdog_timer_fn) from [] (hrtimer_run_queues+0x1d0/0x3a8) [34922.214309] [] (hrtimer_run_queues) from [] (run_local_timers+0x8/0x14) [34922.214325] [] (run_local_timers) from [] (update_process_times+0x28/0x5c) [34922.214340] [] (update_process_times) from [] (tick_periodic+0xac/0xcc) [34922.214355] [] (tick_periodic) from [] (tick_handle_periodic+0x24/0x80) [34922.214371] [] (tick_handle_periodic) from [] (twd_handler+0x30/0x44) Signed-off-by: chen jie --- fs/splice.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/splice.c b/fs/splice.c index de2ede0..f4ce9e8 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -989,6 +989,8 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, sd->pos = prev_pos + ret; goto out_release; } + + cond_resched(); } done: -- 1.8.3.4