Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1064127pxy; Sun, 15 Aug 2021 08:39:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz28PYOBu5XNCItQjKos0nJeqkNW3bmJRuRzpGdhFjQbie0gNvyeUO8tnXrfKW7FaKwoDg/ X-Received: by 2002:a17:906:4fd6:: with SMTP id i22mr12135172ejw.92.1629041993209; Sun, 15 Aug 2021 08:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629041993; cv=none; d=google.com; s=arc-20160816; b=y/TG65nIzW6N+dA7Iv2sJgyM0aRqa9R736bp+eM4QjBKtTh0iCFvONCSBuRAHDizlw VHgQBcYltOpQQ+vCExuTSxzNb0ErLKAHgcZ0OHXtX1ZT/KidHlHz1PbpNNshd6g+Hdh7 JwGi+gCtlb/BeBTL4wh1yjucWWRAEQNW93tGAjbHpKe3gcAN+yrLZumwEL31QimQBsPT of6U64X0EVC69Bf3ak+3Plm0c6FPmtYcsl9Vx98myJM0SNyNLEcYivSB0pzo3E0BWvrY vLlXUveaJmnSfh4HI8OqPJb6yTzCTLkobHYl/A327VvfcPTmwWUn1lz6uVxMwcTkuYHw dJxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mkItBcfYta9GiLY1XdzjdMQtN+rmim/fP8lAy6Iic9E=; b=i8ffwWUeDP8IuGl1nCAIPWrXEqK4PUpZPAI4eBp0athbJcn/766aAVFisOLLVVj0N0 uvI/5aB3Kty/fcu3cEB06kigZfFbkcK6D7PpfRCWV7UzDY26x6cOWrMMYcwQrJ7llO1O tUesSHJVgbos3U7UXzLgXYAfezhNTjZSqEKed0vaX1hmFQr66BOegz++WQI8YJa14v5e RF3srEpoikeW9dMSE0Ko2Galvhbned4nQq9Fsf+ZSed80lmTXT6fNOtHXuweHrAWb2D6 qEl/jLf+p786Wu1fqx3biVlBQCN81yt4K22ambf70YRxID9NcIppKftjjEkbAnn+XjBY 5Lsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o20si7366620ejx.330.2021.08.15.08.39.23; Sun, 15 Aug 2021 08:39:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238136AbhHOPhs (ORCPT + 99 others); Sun, 15 Aug 2021 11:37:48 -0400 Received: from verein.lst.de ([213.95.11.211]:51934 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbhHOPhr (ORCPT ); Sun, 15 Aug 2021 11:37:47 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 3DD6167357; Sun, 15 Aug 2021 17:37:14 +0200 (CEST) Date: Sun, 15 Aug 2021 17:37:13 +0200 From: Christoph Hellwig To: Alex Sierra Cc: akpm@linux-foundation.org, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jgg@nvidia.com, jglisse@redhat.com, John Hubbard Subject: Re: [PATCH v6 02/13] mm: remove extra ZONE_DEVICE struct page refcount Message-ID: <20210815153713.GA32384@lst.de> References: <20210813063150.2938-1-alex.sierra@amd.com> <20210813063150.2938-3-alex.sierra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210813063150.2938-3-alex.sierra@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 8ae31622deef..d48a1f0889d1 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1218,7 +1218,7 @@ __maybe_unused struct page *try_grab_compound_head(struct page *page, int refs, > static inline __must_check bool try_get_page(struct page *page) > { > page = compound_head(page); > - if (WARN_ON_ONCE(page_ref_count(page) <= 0)) > + if (WARN_ON_ONCE(page_ref_count(page) < (int)!is_zone_device_page(page))) Please avoid the overly long line. In fact I'd be tempted to just not bother here and keep the old, more lose check. Especially given that John has a patch ready that removes try_get_page entirely.