From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6E04C7F51 for ; Tue, 19 Nov 2013 17:24:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id F362DAC013 for ; Tue, 19 Nov 2013 15:24:25 -0800 (PST) Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id qrDDcbp72wPQIixy for ; Tue, 19 Nov 2013 15:24:24 -0800 (PST) Message-ID: <528BF327.2050802@sandeen.net> Date: Tue, 19 Nov 2013 17:24:23 -0600 From: Eric Sandeen MIME-Version: 1.0 Subject: Re: [PATCH] xfs: prevent spurious "head behind tail" warnings References: <1384900659-22215-1-git-send-email-david@fromorbit.com> <528BEF71.1000607@sgi.com> In-Reply-To: <528BEF71.1000607@sgi.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Mark Tinguely , Dave Chinner Cc: xfs@oss.sgi.com On 11/19/13, 5:08 PM, Mark Tinguely wrote: > On 11/19/13 16:37, Dave Chinner wrote: >> From: Dave Chinner >> >> When xlog_space_left() cracks the grant head and the log tail, it >> does so without locking to synchronise the sampling of the >> variables. It samples the grant head first, so if there is a delay >> before it smaples the log tail, there is a window where the log tail >> could have moved onwards and be moved past the sampled value of the >> grant head. This then leads to the "xlog_space_left: head behind >> tail" warning message. >> >> To avoid spurious output in this situation, swap the order in which >> the variables are cracked. This means that the head may grant head >> may move if there is a delay, but the log tail will be stable, hence >> ensure the tail does not jump the head accidentally. >> >> While this avoids the spurious head behind tail problem, it >> introduces the opposite problem - the head can move more than a full >> cycle past the tail. The code already handles this case by >> indicating that the log is full (i.e. zero space available) but >> that's still (generally) a spurious situation. >> >> Hence, if we detect that the head is more than a cycle ahead of the >> tail or the head is behind the tail, start the calculation again by >> resampling the variables and trying again. If we get too many >> resamples, then throw a warning and return a full or empty log >> appropriately. >> >> Signed-off-by: Dave Chinner >> --- > > I am still getting the debug message: > > xlog_verify_grant_tail: space > BBTOB(tail_blocks) > > This is a real over grant. It has been a while since I did all the tests, but basically the only way to stop it is to have a lock between checking for xlog_space_left() and actually reserving the space. > > I am not a fan of another band-aid on a problem that is caused because we are granting space without locks. Mark, can you remind us of your testcase that produces this? (sorry, I guess I should search for that old thread...) Thanks, -Eric > --Mark. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs