From: "Yan, Zheng" Subject: Re: [PATCH] libceph: wake up sync waiter when unregistering request Date: Tue, 29 Nov 2016 23:03:21 +0800 Message-ID: <20559259-27E6-4A70-85CE-FD3F09DAB27D@redhat.com> References: <20161129114921.62964-1-zyan@redhat.com> Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933717AbcK2PD0 (ORCPT ); Tue, 29 Nov 2016 10:03:26 -0500 In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org List-ID: To: Ilya Dryomov Cc: Ceph Development > On 29 Nov 2016, at 22:58, Ilya Dryomov wrote: > > On Tue, Nov 29, 2016 at 2:59 PM, Yan, Zheng wrote: >> >>> On 29 Nov 2016, at 21:54, Ilya Dryomov wrote: >>> >>> On Tue, Nov 29, 2016 at 12:49 PM, Yan, Zheng wrote: >>>> Current code does not wake up sync waiter if osd replies error >>>> or the request does not want ondisk ack. >>> >>> Hi Zheng, >>> >>> Did you mean to write "and" instead of "or" - "if osd replies error >>> *and* the request does not want ondisk ack”? >> >> I mean ‘or’. The code does not wake up sync waiter in either of these two cases. > > It does wake the sync waiter (r_safe_completion) on error, but only > if ondisk ack was requested. If ondisk ack wasn't requested, it's not > woken up, success or error. > > By not setting CEPH_OSD_FLAG_ONDISK, the submitter is indicating that > *any* reply is fine. Blocking on the safe reply instead of any reply > in the !CEPH_OSD_FLAG_ONDISK case sounds wrong. > > What is the motivation for this patch? I saw fsstress hang at ceph_osdc_sync several times. [52310.533483] sysrq: SysRq : Show Blocked State [52310.534057] task PC stack pid father [52310.534653] fsstress D14656 2836 2834 0x00000000 [52310.535568] ffff880036cff200 ffff88003e2dac80 0000000000002fa3 ffff88003e3142c0 [52310.536529] ffff88003fd18318 ffffc900038b7d48 ffffffff819354cc ffffffff00000000 [52310.537464] 000000013e314ae0 ffff88003e314890 ffff88003fd18318 ffff88003fd18300 [52310.538396] Call Trace: [52310.538762] [] ? __schedule+0x6ac/0x880 [52310.539326] [] schedule+0x73/0x90 [52310.539840] [] schedule_timeout+0x31/0x5d0 [52310.540425] [] ? mark_held_locks+0x76/0x90 [52310.540980] [] ? _raw_spin_unlock_irq+0x27/0x50 [52310.541582] [] ? trace_hardirqs_on_caller+0x18d/0x1c0 [52310.542217] [] wait_for_completion+0x8b/0x100 [52310.542788] [] ? wake_up_q+0x70/0x70 [52310.543380] [] ceph_osdc_sync+0xc8/0x150 [libceph] [52310.543990] [] ? SyS_tee+0x3b0/0x3b0 [52310.544569] [] ceph_sync_fs+0x3a/0xb0 [ceph] [52310.545158] [] sync_fs_one_sb+0x1b/0x20 [52310.545699] [] iterate_supers+0x7e/0xe0 [52310.546258] [] sys_sync+0x50/0x80 [52310.546849] [] entry_SYSCALL_64_fastpath+0x18/0xad > > Thanks, > > Ilya