From patchwork Thu Jun 13 01:54:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 2713101 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 754E6C1459 for ; Thu, 13 Jun 2013 01:55:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C51E12021D for ; Thu, 13 Jun 2013 01:55:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1A0C2021B for ; Thu, 13 Jun 2013 01:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757003Ab3FMBzI (ORCPT ); Wed, 12 Jun 2013 21:55:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34265 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756400Ab3FMBzH (ORCPT ); Wed, 12 Jun 2013 21:55:07 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 07D77A52D8; Thu, 13 Jun 2013 03:55:05 +0200 (CEST) Date: Thu, 13 Jun 2013 11:54:56 +1000 From: NeilBrown To: Bodo Stroesser Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org Subject: Re: sunrpc/cache.c: races while updating cache entries Message-ID: <20130613115456.02e28f94@notabene.brown> In-Reply-To: <61eb00$3oamkh@dgate20u.abg.fsc.net> References: <61eb00$3oamkh@dgate20u.abg.fsc.net> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 03 Jun 2013 16:27:06 +0200 Bodo Stroesser wrote: > On Fri, Apr 19, 2013 at 06:56:00PM +0200, Bodo Stroesser wrote: > > > > We started the test of the -SP2 (and mainline) series on Tue, 9th, but had no > > success. > > We did _not_ find a problem with the patches, but under -SP2 our test scenario > > has less than 40% of the throughput we saw under -SP1. With that low > > performance, we had a 4 day run without any dropped RPC request. But we don't > > know the error rate without the patches under these conditions. So we can't > > give an o.k. for the patches yet. > > > > Currently we try to find the reason for the different behavior of SP1 and SP2 > > > > Hi, > > sorry for the delay. Meanwhile we found the reason for the small throughput > with -SP2. The problem resulted from a change in our own software. > > Thus I could fix this and started a test on last Tuesday. I stopped the test > today after 6 days without any lost RPC. Without the patches I saw the first > dropped RPC after 3 hours. Thus, I think the patches for -SP2 are fine. > > @Neil: would patch 0006 of the -SP1 patchset be a good additional change for > mainline? > > Bodo Thanks for all the testing. Bruce: where are you at with these? Are you holding one to some that I sent previously, or should I resend them all? Bodo: no, I don't think that patch is appropriate for mainline. It causes sunrpc_cache_pipe_upcall to abort if ->expiry_time is zero. There is certainly no point in doing an upcall in that case, but the code in mainline is quite different to the code in -SP1 against which that patch made sense. For mainline an equivalent optimisation which probably makes the interesting case more obvious would be: i.e. trap that case in cache_check. NeilBrown diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index d01eb07..291cc47 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -262,7 +262,8 @@ int cache_check(struct cache_detail *detail, if (rqstp == NULL) { if (rv == -EAGAIN) rv = -ENOENT; - } else if (rv == -EAGAIN || age > refresh_age/2) { + } else if (rv == -EAGAIN || + (refresh_age > 0 && age > refresh_age/2)) { dprintk("RPC: Want update, refage=%ld, age=%ld\n", refresh_age, age); if (!test_and_set_bit(CACHE_PENDING, &h->flags)) {