From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751599AbdIQRpm (ORCPT ); Sun, 17 Sep 2017 13:45:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56416 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbdIQRpl (ORCPT ); Sun, 17 Sep 2017 13:45:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B11B1C07188D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jglisse@redhat.com Date: Sun, 17 Sep 2017 10:45:34 -0700 From: Jerome Glisse To: Michal Hocko Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Johannes Weiner , Vladimir Davydov Subject: Re: [PATCH] mm/memcg: avoid page count check for zone device Message-ID: <20170917174534.GC11906@redhat.com> References: <20170914190011.5217-1-jglisse@redhat.com> <20170915070100.2vuxxxk2zf2yceca@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170915070100.2vuxxxk2zf2yceca@dhcp22.suse.cz> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 17 Sep 2017 17:45:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 09:01:00AM +0200, Michal Hocko wrote: > On Thu 14-09-17 15:00:11, jglisse@redhat.com wrote: > > From: Jérôme Glisse > > > > Fix for 4.14, zone device page always have an elevated refcount > > of one and thus page count sanity check in uncharge_page() is > > inappropriate for them. > > > > Signed-off-by: Jérôme Glisse > > Reported-by: Evgeny Baskakov > > Cc: Andrew Morton > > Cc: Johannes Weiner > > Cc: Michal Hocko > > Cc: Vladimir Davydov > > Acked-by: Michal Hocko > > Side note. Wouldn't it be better to re-organize the check a bit? It is > true that this is VM_BUG so it is not usually compiled in but when it > preferably checks for unlikely cases first while the ref count will be > 0 in the prevailing cases. So can we have > VM_BUG_ON_PAGE(page_count(page) && !is_zone_device_page(page) && > !PageHWPoison(page), page); > > I would simply fold this nano optimization into the patch as you are > touching it already. Not sure it is worth a separate commit. I am traveling sorry for late answer. This nano optimization make sense Andrew do you want me to respin or should we leave it be ? I don't mind either way. Cheers, Jérôme