Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933531AbcLGXQu (ORCPT ); Wed, 7 Dec 2016 18:16:50 -0500 Received: from casper.infradead.org ([85.118.1.10]:53362 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932141AbcLGXQt (ORCPT ); Wed, 7 Dec 2016 18:16:49 -0500 Date: Wed, 7 Dec 2016 23:16:44 +0000 (GMT) From: James Simmons To: Oleg Drokin cc: Dan Carpenter , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Linux Kernel Mailing List , Jinshan Xiong , Lustre Development List Subject: Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly In-Reply-To: Message-ID: References: <1480726409-20350-1-git-send-email-jsimmons@infradead.org> <1480726409-20350-5-git-send-email-jsimmons@infradead.org> <20161205205537.GB31465@mwanda> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161207_231644_138368_774CE725 X-CRM114-Status: GOOD ( 15.09 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 29 > On Dec 5, 2016, at 3:55 PM, Dan Carpenter wrote: > > > On Fri, Dec 02, 2016 at 07:53:11PM -0500, James Simmons wrote: > >> @@ -3183,8 +3182,10 @@ static int discard_cb(const struct lu_env *env, struct cl_io *io, > >> /* page is top page. */ > >> info->oti_next_index = osc_index(ops) + 1; > >> if (cl_page_own(env, io, page) == 0) { > >> - KLASSERT(ergo(page->cp_type == CPT_CACHEABLE, > >> - !PageDirty(cl_page_vmpage(page)))); > >> + if (!ergo(page->cp_type == CPT_CACHEABLE, > >> + !PageDirty(cl_page_vmpage(page)))) > >> + CL_PAGE_DEBUG(D_ERROR, env, page, > >> + "discard dirty page?\n"); > > > > > > I don't understand the point of the ergo macro. There are way too many > > double negatives (some of them hidden for my small brain). How is that > > simpler than just writing it out: > > > > if (page->cp_type == CPT_CACHEABLE && > > PageDirty(cl_page_vmpage(page)) > > CL_PAGE_DEBUG(D_ERROR, env, page, "discard dirty page?\n"); > > I guess it makes it sound chic or something? > I am not a huge fan of it either, esp. in a case like this, though > it might be somewhat more convenient in assertions (where this is converted from). Not a fan either. Resubmitted patch with ergo removed.