Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp360173pxb; Thu, 9 Sep 2021 02:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlfW0FoYIOrGmk+GZo3cPaRxhO8e8eovJLi6rtNL9J5qcvvEtyWAv8jqT+hXvOb1rpIW5T X-Received: by 2002:a6b:d209:: with SMTP id q9mr1913460iob.206.1631180331851; Thu, 09 Sep 2021 02:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631180331; cv=none; d=google.com; s=arc-20160816; b=LJCfXkxXPJMKWnx8rEQglD/etImonaeJ+dVpQG8U6Dd78WN83Nf3ILsPbAM0xxO7cH bSVZ9c0Q7IW24XZo7WWKX72MCgbUg1kAlNXLxsPe5di/BSZ3p67Caby8eTLc+vaK5MqD PWU1chCxAGGHv7x5qSw0g6lECA+4DqgVVWsTgnjQaIcx8MhAgH3YsKnUPB3mGf+wX5GO 0M42NuEDPaC5BuGIbdAr2cjyDEJTTgD/i850iLrlsE928ztOt2MFHB+M/rRWNlkrdDIM KrnPXLgmh4AmvOTBqhAU6ZwOzl5AjKyqEgk1Jk8+j3YisZgBi/mxATfMfKrc4j1GGZWD 5hGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:from:references:cc:to:dkim-signature; bh=hnkexf1NKYb40g+6TkQdOP3IQclUoy40kRSjUx+uIvA=; b=aruxpp3fzty8at/Ecb2mCsIu63ATMxqtMOOR0Fk5p/8VBdnTLoqisWI44MrZzu2CjJ Sn2YQTDhCSNzj4SSq+2kpvyVTzIrgPu2P5c5vEefw0ZnJq+brWC8JWSpxRcoD52zR1Dq SNUZ/HR5PBK1LHWhHaFvXoQDS5rROCt7FOzWKWZ8+2GH6LHA/hCsTM09JeLM6wsDg663 v8q5rbLuj0BUnSQkFnJ+OQna0/OmQioOjKJAKSSEzDDm8vxDkerjKaX9WzsQUgqglubN 9lq7lpTuilx/4PxQmud8Nk+W8FNh6BLvjz1bXdehZx3NrbHKo9xLfN9tKjkN17LY0id+ jynA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hQIfrsI7; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si1373837jat.80.2021.09.09.02.38.40; Thu, 09 Sep 2021 02:38:51 -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=@redhat.com header.s=mimecast20190719 header.b=hQIfrsI7; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232860AbhIIJik (ORCPT + 99 others); Thu, 9 Sep 2021 05:38:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60025 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbhIIJij (ORCPT ); Thu, 9 Sep 2021 05:38:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631180249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hnkexf1NKYb40g+6TkQdOP3IQclUoy40kRSjUx+uIvA=; b=hQIfrsI707PfLetJIqESt7B5r96kcs3fDPhtXTkb0s6rZgtVXTwq0lm4sDa6Uw4z5Qipr9 PE1yxiVJVMreiVmaF/Xzpma2+M4WZyzSQN81PPwr58AW4PIo12NoOM8Cu/fEOoeYGOX9lS sqQsrN+WZK0CMjSTxotWPPNKlGRH8p4= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-cRhcgTiDOgeIEhDWCVB4YQ-1; Thu, 09 Sep 2021 05:37:28 -0400 X-MC-Unique: cRhcgTiDOgeIEhDWCVB4YQ-1 Received: by mail-wr1-f71.google.com with SMTP id m18-20020adfe952000000b0015b0aa32fd6so319306wrn.12 for ; Thu, 09 Sep 2021 02:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=hnkexf1NKYb40g+6TkQdOP3IQclUoy40kRSjUx+uIvA=; b=JRCOWWhKmIV4SwRH12FPiWFAMY+EzIRnnKN5j8AIhDb84GwpcSsuEHZmzBLAqDuMI1 MdH9cO5AzfyuwJMmLuEDavfvjAEk2Pc3MHJQKl2aE4wDxZIdCbRO859AE6ZWZE+Ln4fr 0X5npaB9qZbSRhW+XP1kmkjpincAY/sdF37ZjWOEOFdpycQtWaHX6dSwTVIt9G9Hh++O uuMCFkRi0PZM7tU78JdQvaGPKLeEGThnGslpWlZpfMSu3et7GfNn+e/P1Y6wi9NdwMQh kk/JZBelrwY3arhwbpnLD0rdNaBp9ynbJXGRJ82HoBK1aDyg6KzIjiQihsfV41JFK97v u1TA== X-Gm-Message-State: AOAM531YW3bSFPpPpi2BKqHbUMdigy1HdyhOzT+oTIfuB2UpBX20wPJL j7L54+nhJJoLf4Yi1BJw4fMogfXeRjMjG1GLXRJaPLDwtX3iOzqTjkyiKNwZ1srejEj0R0CMU8y JBhNESH2iGHYaZ1qqXp8tRmvAmxm3AqW/TpOOo8jtISPy10bRYtEFWIt338FrGR8yGqJfyvwK X-Received: by 2002:a05:6000:1081:: with SMTP id y1mr2391662wrw.415.1631180247669; Thu, 09 Sep 2021 02:37:27 -0700 (PDT) X-Received: by 2002:a05:6000:1081:: with SMTP id y1mr2391637wrw.415.1631180247410; Thu, 09 Sep 2021 02:37:27 -0700 (PDT) Received: from [192.168.3.132] (p4ff23fe4.dip0.t-ipconnect.de. [79.242.63.228]) by smtp.gmail.com with ESMTPSA id a10sm1250078wrd.51.2021.09.09.02.37.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 02:37:26 -0700 (PDT) To: Vlastimil Babka , John Hubbard , Miaohe Lin , akpm@linux-foundation.org Cc: iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210904091839.20270-1-linmiaohe@huawei.com> <3b36529f-ab97-ddfe-0407-66f0cd1fd38d@redhat.com> <2d06db75-5c26-8fe2-6883-ac99056a9894@redhat.com> <80cfffdc-227e-c045-be74-1c08fb62c1e3@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH] mm/page_isolation: don't putback unisolated page Message-ID: <924b4672-0e52-56fb-22a9-b02d8c3ecccf@redhat.com> Date: Thu, 9 Sep 2021 11:37:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.09.21 11:07, Vlastimil Babka wrote: > On 9/9/21 10:56, David Hildenbrand wrote: >> On 09.09.21 00:42, John Hubbard wrote: >>> On 9/7/21 2:56 AM, David Hildenbrand wrote: >>> ... >>>>> If this can be handled gracefully, then I'd rather go with VM_WARN_ON. >>>>> Maybe even WARN_ON_ONCE? >>>>> >>>> >>>> I think either VM_BUG_ON() or VM_WARN_ON() -- compiling the runtime >>>> checks out -- should be good >>>> enough. >>>> >>>> I'd just go with VM_BUG_ON(), because anybody messing with >>>> __isolate_free_page() should clearly spot >>>> that we expect the current handling. But no strong opinion. >>>> >>> >>> If in doubt, WARN*() should be preferred over BUG*(). There's a pretty long >>> history of "don't kill the machine unless you have to" emails about this, let >>> me dig up one...OK, maybe not the best example, but the tip of the iceberg: >> >> Please note the subtle difference between BUG_ON and VM_BUG_ON. We expect >> VM_BUG_ON to be compiled out on any production system. So it's really only a >> mean to identify things that really shouldn't be like that during >> debugging/testing. > > IIRC Fedora used to have CONFIG_DEBUG_VM enabled, did it change? Excellent question. Apparently you are right. Fortunately it's not a distro to use in production ;) In kernel-ark: redhat/configs/fedora/generic/CONFIG_DEBUG_VM:CONFIG_DEBUG_VM=y While for ARK (rhel-next so to say) redhat/configs/ark/generic/CONFIG_DEBUG_VM:# CONFIG_DEBUG_VM is not set So yes, the VM_WARN_ON would then be preferred in that case. But it's something that should never ever happen unless reviewers and developers really mess up, so I don't actually would sleep over that. We have other WARN... that can trigger more easily. > >> Using WARN... instead of VM_BUG_ON is even worse for production systems. >> There are distros that set panic_on_warn, essentially converting WARN... >> into BUG... > > Uh, does any distro really do that? Apparently, so I was told by Greg a year ago or so when wanting to add WARN_ON(). The advisory is to us pr_warn_once() instead. I rememebr it was a debian based distro. -- Thanks, David / dhildenb