From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:54437 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752927AbcAWAMF (ORCPT ); Fri, 22 Jan 2016 19:12:05 -0500 Date: Sat, 23 Jan 2016 00:12:02 +0000 From: Al Viro To: Mike Marshall Cc: Linus Torvalds , linux-fsdevel Subject: Re: Orangefs ABI documentation Message-ID: <20160123001202.GJ17997@ZenIV.linux.org.uk> References: <20160122170838.GZ17997@ZenIV.linux.org.uk> <20160122174338.GA17997@ZenIV.linux.org.uk> <20160122183720.GB17997@ZenIV.linux.org.uk> <20160122200442.GF17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jan 22, 2016 at 03:30:02PM -0500, Mike Marshall wrote: > The userspace daemon (client-core) that reads/writes to the device > restarts automatically if it stops for some reason... I believe active > ops are marked "purged" when this happens, and when client-core > restarts "purged" ops are retried (once)... see the comment > in waitqueue.c "if the operation was purged in the meantime..." > > I've tried to rattle Walt and Becky's chains to see if they > can describe it better... What I mean is the following sequence: Syscall: puts op into request list, sleeps in wait_for_matching_downcall() Daemon: exits, markes purged, wakes Syscall up Daemon gets restarted Daemon calls read(), finds op still on the list Syscall: finally gets the timeslice, removes op from the list, decides to resubmit This is very hard to hit - normally by the time we get around to read() from restarted daemon the waiter had already been woken up and already removed the purged op from the list. So in practice you probably had never hit that case. However, it is theoretically possible. What I propose to do is to have purged requests that are still in the lists to be skipped by orangefs_devreq_read() and orangefs_devreq_remove_op(). IOW, pretend that the race had been won by whatever had been waiting on that request and got woken up when it had been purged. Note that by the time it gets resubmitted, it already has the 'purged' flag removed - set_op_state_waiting(op) is done when we are inserting into request list and it leaves no trace of OP_VFS_STATE_PURGED. So I'm not talking about the resubmitted stuff; just the one that had been in queue since before the daemon restart and hadn't been removed from there yet.