Received: by 10.223.185.116 with SMTP id b49csp5500117wrg; Wed, 7 Mar 2018 12:53:20 -0800 (PST) X-Google-Smtp-Source: AG47ELudY38T2doJTnuNUXVU5Ez97s9SzsPV6ROMY5/2Ie09T1cBmwCtXmUKx3sXGwgyw22MvnEp X-Received: by 10.98.91.66 with SMTP id p63mr22044882pfb.163.1520456000630; Wed, 07 Mar 2018 12:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520456000; cv=none; d=google.com; s=arc-20160816; b=XbKS1ktCF771EBopvCw0yeLrim6OLWkijuhuK51bdEYUnUaLSjp1sBqKYkFKa1QuFo nhLZOTHCt55qM6r0rRtGSu60oZzQCrHKkLks7VeOzGT3UAKVI7+DSgaYrEr0FjShUYos ISgS8s2hLtzlFCeor9DIKeNFjOhXB/beg1U5bnti0IKjuhA1BsM5AX58m5XNAoKYtsx/ +7Gy21IDvgU9qDSe1CoWC8l0RljfniRx37FUnhq4k0F3xtxL3FWFKURU83yNnYQeEbw7 16JymsEo6qrfSbRIio9Ai9+fo+XUDKT4EDSUarQy90GFm0JSKyFQ50olmcSYhjMvL5Gm Z3QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=pvJC2+QJKTXGfRU6GpTMhnLcqhfzXiYWI+CCti41pEM=; b=t7w7dqlMuuxCPNEYOPC9PJFDnGd9Y+CllfapdJFQSGg+mnRCDv4PWy+Ju2NGvSqQY5 oV7ca1x0Uw9I8NMZquNR931/qGWqiUopFxTcnAP9tlbE9I+bl3ZWlJJHFABhNAj9QOcp zR0D1KuD6FBEK2RZL0YYFZg4rNbTHtEnejjRfO5Yb/6+J+pBBk3PcXg/DpZ0vDwO0D4K W8kI4+6iiDTHU7vzsfMZ4qGVlQZfFCdSzYPkK8nVr2K2ESVz/hTJ1Ymby1SvYRcOF+Su 3GObWNVGDlg3mh6sKiDm/Dh3//VozT9BiBwpNPwBcPidwJnlxSXhE21pxoiRPnr9K7kU MN2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si3614616pgu.428.2018.03.07.12.53.06; Wed, 07 Mar 2018 12:53:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934435AbeCGUvn convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Mar 2018 15:51:43 -0500 Received: from mga04.intel.com ([192.55.52.120]:27444 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934389AbeCGUvm (ORCPT ); Wed, 7 Mar 2018 15:51:42 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 12:51:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,437,1515484800"; d="scan'208";a="36801494" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 07 Mar 2018 12:51:41 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 7 Mar 2018 12:51:41 -0800 Received: from FMSMSX109.amr.corp.intel.com ([169.254.15.144]) by fmsmsx120.amr.corp.intel.com ([169.254.15.251]) with mapi id 14.03.0319.002; Wed, 7 Mar 2018 12:51:40 -0800 From: "Dilger, Andreas" To: NeilBrown CC: "Drokin, Oleg" , Greg Kroah-Hartman , James Simmons , "Linux Kernel Mailing List" , Lustre Development List Subject: Re: [PATCH 02/17] staging: lustre: fix bug in osc_enter_cache_try Thread-Topic: [PATCH 02/17] staging: lustre: fix bug in osc_enter_cache_try Thread-Index: AQHTsbWQ2ccTLeOOBkq/nm4mGZ8D5KPFzt6A Date: Wed, 7 Mar 2018 20:51:39 +0000 Message-ID: <0512F618-CADE-434F-83F9-0452680BFF33@intel.com> References: <151994679573.7628.1024109499321778846.stgit@noble> <151994708510.7628.7308229784516417641.stgit@noble> In-Reply-To: <151994708510.7628.7308229784516417641.stgit@noble> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.6.233] Content-Type: text/plain; charset="us-ascii" Content-ID: <217D8EB40089774A9E6BF9AE695A666C@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 1, 2018, at 16:31, NeilBrown wrote: > > The lustre-release patch commit bdc5bb52c554 ("LU-4933 osc: > Automatically increase the max_dirty_mb") changed > > - if (cli->cl_dirty + PAGE_CACHE_SIZE <= cli->cl_dirty_max && > + if (cli->cl_dirty_pages < cli->cl_dirty_max_pages && > > When this patch landed in Linux a couple of years later, it landed as > > - if (cli->cl_dirty + PAGE_SIZE <= cli->cl_dirty_max && > + if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages && > > which is clearly different ('<=' vs '<'), and allows cl_dirty_pages to > increase beyond cl_dirty_max_pages - which causes a latter assertion > to fails. > > Fixes: 3147b268400a ("staging: lustre: osc: Automatically increase the max_dirty_mb") > Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger > --- > drivers/staging/lustre/lustre/include/obd.h | 2 +- > drivers/staging/lustre/lustre/osc/osc_cache.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h > index 4368f4e9f208..f1233ca7d337 100644 > --- a/drivers/staging/lustre/lustre/include/obd.h > +++ b/drivers/staging/lustre/lustre/include/obd.h > @@ -191,7 +191,7 @@ struct client_obd { > struct sptlrpc_flavor cl_flvr_mgc; /* fixed flavor of mgc->mgs */ > > /* the grant values are protected by loi_list_lock below */ > - unsigned long cl_dirty_pages; /* all _dirty_ in pahges */ > + unsigned long cl_dirty_pages; /* all _dirty_ in pages */ > unsigned long cl_dirty_max_pages; /* allowed w/o rpc */ > unsigned long cl_dirty_transit; /* dirty synchronous */ > unsigned long cl_avail_grant; /* bytes of credit for ost */ > diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c > index 1c70a504ee89..459503727ce3 100644 > --- a/drivers/staging/lustre/lustre/osc/osc_cache.c > +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c > @@ -1529,7 +1529,7 @@ static int osc_enter_cache_try(struct client_obd *cli, > if (rc < 0) > return 0; > > - if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages && > + if (cli->cl_dirty_pages < cli->cl_dirty_max_pages && > atomic_long_read(&obd_dirty_pages) + 1 <= obd_max_dirty_pages) { > osc_consume_write_grant(cli, &oap->oap_brw_page); > if (transient) { > > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation