From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEC5DC2D0DB for ; Mon, 20 Jan 2020 15:43:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 983FC217F4 for ; Mon, 20 Jan 2020 15:43:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 983FC217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 303246B0678; Mon, 20 Jan 2020 10:43:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28D3E6B0679; Mon, 20 Jan 2020 10:43:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1557B6B067A; Mon, 20 Jan 2020 10:43:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id EE3FD6B0678 for ; Mon, 20 Jan 2020 10:43:19 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id BED20824805A for ; Mon, 20 Jan 2020 15:43:19 +0000 (UTC) X-FDA: 76398431718.28.lace71_916e617d03c59 X-HE-Tag: lace71_916e617d03c59 X-Filterd-Recvd-Size: 4412 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jan 2020 15:43:19 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id c14so30062584wrn.7 for ; Mon, 20 Jan 2020 07:43:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Sj2OJDyUF+Gs3NUJLayq5kxeopk2pOJl5Jx9/Iosi0s=; b=NuYBU/B7sYjwEB4bdCW4NQhzOMdyLlRE4v9qNNUkbaBqkN8RMRo3sl2EEyu5F6NgA5 tRySwyufmA1KIFp4FIM/k6QjkCYn1wLV/jGHEnEiCcxzMz/2sPnJ2MhBw5sS9DMqI1eJ 2PWLLn6BUO4s0hOFkBJWO40KecKS04Fq+tZa0uF7ySeQK3KoTzCN7DIviYNtKhNgZe00 oqYpPUsfv6rGhZJtF1LUK3/7t351cW6VXYR6e9WPEoeO3pHyRZv/PJMcG2vnFLMLGM+o 4sccRS+/cSPNvsNo2PWRDUn44POqFW2QkqdDjc3PDuCYfeKiIYzoZUGRVmvlWFJxFbYi 6mwg== X-Gm-Message-State: APjAAAWRA9atTCjObJX3/QFfY6oNjoVdCaNYpZugmCx71odnxYsG0NCv 8Xg4h9+RZtuJMeA6MvZ5w+8= X-Google-Smtp-Source: APXvYqxeiJDkSuTikFlnLFD18uLcUXUfw88VtFEHnGvcvq5ZQ4uskDSiDHvv+NORnSeanVqL3Rpk0g== X-Received: by 2002:adf:c145:: with SMTP id w5mr98337wre.205.1579534998158; Mon, 20 Jan 2020 07:43:18 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id s3sm23187912wmh.25.2020.01.20.07.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 07:43:16 -0800 (PST) Date: Mon, 20 Jan 2020 16:43:15 +0100 From: Michal Hocko To: David Hildenbrand Cc: Qian Cai , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm v2] mm/page_isolation: fix potential warning from user Message-ID: <20200120154315.GK18451@dhcp22.suse.cz> References: <20200120131909.813-1-cai@lca.pw> <8c56268d-9b8a-f62e-eca9-7707852a2aaf@redhat.com> <96675869-3815-4E98-8492-1D84F5B42AED@lca.pw> <74aebdfe-e727-acd6-e664-6e63948a68ae@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000440, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 20-01-20 15:13:54, David Hildenbrand wrote: > On 20.01.20 15:11, Qian Cai wrote: > >> On Jan 20, 2020, at 9:01 AM, David Hildenbrand wr= ote: > >> On 20.01.20 14:56, Qian Cai wrote: [...] > >>>> FWIW, I'd prefer this change without any such cleanups (e.g., I do= n't > >>>> like returning a bool from this function and the IS_ERR handling, = makes > >>>> the function harder to read than before) > >>> > >>> What is Michal or Andrew=E2=80=99s opinion? BTW, a bonus point to r= eturn a bool > >>> is that it helps the code robustness in general, as UBSAN will be a= ble to > >>> catch any abuse. > >>> > >> > >> A return type of bool on a function that does not test a property > >> ("has_...", "is"...") is IMHO confusing. > >=20 > > That is fine. It could be renamed to set_migratetype_is_isolate() or > > is_set_migratetype_isolate() which seems pretty minor because we > > have no consistency in the naming of this in linux kernel at all, i.e= ., > > many existing bool function names without those test of properties.=20 >=20 > It does not query a property, so "is_set_migratetype_isolate()" is plai= n > wrong. >=20 > Anyhow, Michal does not seem to care. Well, TBH I have missed this change. My bad. I have mostly checked that the WARN_ONCE is not gated by the check and didn't expect more changes. But I have likely missed that change in the previous version already. You guys are too quick with new version to my standard. Anyway, I do agree that bool is clumsy here. Returning false on success is just head scratching. Nobody really consumes the errno value but I would just leave it that way or if there is a strong need to change then do it in a separate patch. --=20 Michal Hocko SUSE Labs