From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by kanga.kvack.org (Postfix) with ESMTP id 14F9C6B006E for ; Mon, 15 Jun 2015 17:55:39 -0400 (EDT) Received: by igbos3 with SMTP id os3so30013954igb.0 for ; Mon, 15 Jun 2015 14:55:38 -0700 (PDT) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com. [2607:f8b0:4001:c03::233]) by mx.google.com with ESMTPS id a11si11009692icm.68.2015.06.15.14.55.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 14:55:38 -0700 (PDT) Received: by iebgx4 with SMTP id gx4so1257618ieb.0 for ; Mon, 15 Jun 2015 14:55:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150615214338.GH18909@redhat.com> References: <1434388931-24487-1-git-send-email-aarcange@redhat.com> <1434388931-24487-2-git-send-email-aarcange@redhat.com> <20150615214338.GH18909@redhat.com> Date: Mon, 15 Jun 2015 11:55:38 -1000 Message-ID: Subject: Re: [PATCH 1/7] userfaultfd: require UFFDIO_API before other ioctls From: Linus Torvalds Content-Type: multipart/alternative; boundary=90e6ba6e8adea8f885051895841d Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli Cc: "Huangpeng (Peter)" , qemu-devel@nongnu.org, Paolo Bonzini , Pavel Emelyanov , Hugh Dickins , Andrew Morton , "Dr. David Alan Gilbert" , Andres Lagar-Cavilla , Andy Lutomirski , linux-mm@kvack.org, "Kirill A. Shutemov" , Rik van Riel , Johannes Weiner , linux-kernel@vger.kernel.org, Sanidhya Kashyap , zhang.zhanghailiang@huawei.com, Dave Hansen , Mel Gorman , Peter Feiner , kvm@vger.kernel.org --90e6ba6e8adea8f885051895841d Content-Type: text/plain; charset=UTF-8 On Jun 15, 2015 11:43 AM, "Andrea Arcangeli" wrote: > > Several times I got very hardly reproducible bugs noticed purely > because of BUG_ON (not VM_BUG_ON) Feel free to use them while developing. Don't send me patches with your broken debug code, though. For users, a dead machine means that it is less likely you will ever get a bug report. People set "reboot on oops", and when running X is not always something that can be seen anyway. They'll just see a rebooting or a dead machine, and not send you any debug output. This is not negotiable. Seriously. Get rid of the BUG_ON if you expect your patches to be merged mainline. Also, even for debugging, using something like if (WARN_ON_ONCE(...)) return -EINVAL; is the right thing to do. Then you can unwind locks etc, and return cleanly, and you'll only get one warning rather than a stream of them etc. So stop making excuses for your bad BUG_ON use. Do it in private where nobody can see your perversions, or do it right. Linus --90e6ba6e8adea8f885051895841d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Jun 15, 2015 11:43 AM, "Andrea Arcangeli" <aarcange@redhat.com> wrote:
>
> Several times I got very hardly reproducible bugs noticed purely
> because of BUG_ON (not VM_BUG_ON)

Feel free to use them while developing. Don't send me pa= tches with your broken debug code, though.

For users, a dead machine means that it is less likely you w= ill ever get a bug report. People set "reboot on oops", and when = running X is not always something that can be seen anyway. They'll just= see a rebooting or a dead machine, and not send you any debug output.

This is not negotiable. Seriously. Get rid of the BUG_ON if = you expect your patches to be merged mainline.

Also, even for debugging, using something like

=C2=A0=C2=A0=C2=A0 if (WARN_ON_ONCE(...))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;

is the right thing to do. Then you can unwind locks etc, and= return cleanly, and you'll only get one warning rather than a stream o= f them etc.

So stop making excuses for your bad BUG_ON use. Do it in pri= vate where nobody can see your perversions, or do it right.

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Linus

--90e6ba6e8adea8f885051895841d-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org