Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3927798pxb; Mon, 27 Sep 2021 05:55:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycXNA6+HzhBTsGOdtIN6lUUvhZZyYjrzd1Yk68Nn5sXN0VgIDZ4dYtoec8Kfer90VKlQU3 X-Received: by 2002:a17:907:10ca:: with SMTP id rv10mr7803753ejb.41.1632747299501; Mon, 27 Sep 2021 05:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632747299; cv=none; d=google.com; s=arc-20160816; b=GHtc6K2dLihZz+gO9Ohrjef0AkTaIXuu0daWvR0D6g0S1OlkT5me+t1rcLTBnQ1dd2 HjGW8P4uMySLJA9yqRFVUp033QadL+GEBTd8DaUJJ/uqQh2bjY/F45mFs+oRcWz6SEY9 m8IDRF22Hix9fdA8DTQw+zgFZ3Prf0isGCRH2Cd0OH6+98VFZqkufoNXpHPDoNyROFfu vXfY1ps4WXFEpy2880YVXUWl+k1jrTwhOom+5rcl89SxsgGevP3Q4v+yZeq+o094IUJ+ IZXH1ssvdB6gGSSc3apjzbSSWHu3Px7YFXCKgIemzim5Op9bC5O7Ud+OTJyp3f+7vcGi Fvpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=uwRoL4vai1J0WCVDQj2ZNZYEe4M117wFeqCni6D+v3E=; b=LrnRNVEWsUXcMPDSctjG0r6ehXK9i6a6M7wi0S5rPO9RMW8ubDp5+PpK9bCi7S9V1D q1pHl/Bsk9SN6IfqmVzx5jxptNF7/KKVC6Du+wy5uJonrfO44ODFwEAc+3uoxld3Vkb4 2rGftHOrCCTtIKFhVR/ewNUy1AN0YFdyvPs1TjdnCrvN3TF6DC0HgeIR2MMkrXUmq8ST fRRibIlb19n2zKd535k6P9reOr0YzaUoo4o/5X+b0L9omEu+sP+JfAzMSSdalOCJYr/7 T+Y2Aev5bODH+OgaFdCAd5Ctv9/ikrL4nrLopaRBbkwYKQfXsvJ5bmvce25qBsdITQQm etCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lIuP9Ea+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch16si18161284edb.168.2021.09.27.05.54.35; Mon, 27 Sep 2021 05:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lIuP9Ea+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234407AbhI0Mxx (ORCPT + 99 others); Mon, 27 Sep 2021 08:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234360AbhI0Mxx (ORCPT ); Mon, 27 Sep 2021 08:53:53 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B7CC061575 for ; Mon, 27 Sep 2021 05:52:15 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so10063309pjw.0 for ; Mon, 27 Sep 2021 05:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uwRoL4vai1J0WCVDQj2ZNZYEe4M117wFeqCni6D+v3E=; b=lIuP9Ea+24LNri1ZcHUdW/tVNQU6hgWf3lQMcY95jfTE1wQGynD3ga2bdh/5fiQFZc UUVP09bfDPEFimluS++Fl83/d7CDJgAlCM6s2z9A75bueSCVTgNWHl4oDxPmwheDxSrJ Wz4rskU73WgwwIMLriyk9Mo2xpBQ7lBLVWb27Y1T4fgQ3oWzDh8Axg8kb5DKTIX+UKLd oi1lw4uIBnBQkrcXQeGnF1Ux5oyeuTG4aLdnNllda7WUUgOAXxq2nbJix5fZik9fKOYh rB0QzqnBDqd26WDp4QwvOlBSNkkhWGWNml55lp4lVYIio878F2uYtU2DVae0i8gkOoAB qyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uwRoL4vai1J0WCVDQj2ZNZYEe4M117wFeqCni6D+v3E=; b=f3uPWYyWI1iy0HZ7DhDY+PTSVS3npPmDsjR9bF2RijPbxG78zVpn812eLT1oYueIxd SJze3pyfOtCvT750mfA8n2P+IkNkQGATRhYrg7IqPm59uUC6X91x6cicNXoaunTfRZuc Q+2HZJz14PjZIvGtWpaDyBFSLDJOdcosWkO2p06vviSzpHOXMj6kWlxCVufk26PM4Nif uP22UkVGmt0Gg/PzsfsW+zYiz47OHy2Ktu2azuZzjvhesgm/Fy80vOQ0s9YNf05Q9fpT srzTc6HoHSHHUNkEaAFea1Uo5rHDcOQW2M0r+OGMfGMjlLfi6RoJId9PViXg//facVSj xAcQ== X-Gm-Message-State: AOAM531OlFXeTBno2W0kWkwbwERVdfbqJxUeR+gzlIpTN1nPRdFlMkKK JY804vqYhG0Uzm1KAnj/fgU= X-Received: by 2002:a17:90a:8810:: with SMTP id s16mr8581927pjn.7.1632747134920; Mon, 27 Sep 2021 05:52:14 -0700 (PDT) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id q18sm17715537pfj.46.2021.09.27.05.52.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 05:52:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [RFC PATCH 2/8] mm/madvise: remove unnecessary check on madvise_dontneed_free() From: Nadav Amit In-Reply-To: <20210927121902.r5gslag4nvvseoxo@box> Date: Mon, 27 Sep 2021 05:52:12 -0700 Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peter Xu , Andrea Arcangeli , Minchan Kim , Colin Cross , Suren Baghdasarya , Mike Rapoport Content-Transfer-Encoding: quoted-printable Message-Id: <8ACD5AC6-2235-4A62-8044-F686EB26840E@gmail.com> References: <20210926161259.238054-1-namit@vmware.com> <20210926161259.238054-3-namit@vmware.com> <20210927091143.tn6ediykqycu6rtu@box.shutemov.name> <20210927121902.r5gslag4nvvseoxo@box> To: "Kirill A. Shutemov" X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 27, 2021, at 5:19 AM, Kirill A. Shutemov = wrote: >=20 > On Mon, Sep 27, 2021 at 04:05:47AM -0700, Nadav Amit wrote: >> Having said that, if you want, I can turn this condition into >> WARN_ON_ONCE() or VM_BUG_ON(), although I really see no reason to >> do so. >=20 > BUILD_BUG() should be fine here. It does not work. At least my gcc is not smart enough to figure it out in build time. I can put instead: BUILD_BUG_ON(__builtin_constant_p(behavior)); for potentially smarter compilers (clang?), but I doubt it would work.