Received: by 10.192.165.148 with SMTP id m20csp4221508imm; Mon, 30 Apr 2018 14:09:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruIXvjsrhvZhtmTjpi8i6VeFHleu2lSlA3dpOFc2Jszi0EQccwfCIRykvvLfr0bqF9zWPt X-Received: by 2002:a17:902:758a:: with SMTP id j10-v6mr13794345pll.11.1525122564282; Mon, 30 Apr 2018 14:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525122564; cv=none; d=google.com; s=arc-20160816; b=nlcbTkZpNMEkSGAflJlhDWYV6OITOhp2Vq//gdufEaTdlhrTk8nOyxRP9tleG6gSim ahZf5jaKqeDQWf4qfBwvDith+sc5fxntDlZS7hpp7+kFty+JWKROlybt90UcU424bYpy R39O7KKqCGKZNPrCbmF01zYlsUumBmNZBvYnFbUbf1sCiSF/cLGANZK7QEU1wThGmYeB B1lauHI+8GWqCDaVXrEMenq5dvGbj/Xlj0rxnkIWSxW667/061URbwb7JX4GSj5sFvVj toCPl+xNOEI4DxxGNMsjxlsEtZmbvr1oWkMPUFVoemqBevOcPLH6laoAi8u3ld+pb/kd xhLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=EzfSOnjfTnW/HVchZJnNPcNo1TrDsEgmlKlgPA28pHk=; b=mImv2UT+0J7gwo2zqIE7bXfSZcF//1mKuihu0B5FdNTPnAd/dE98Gw2HWPf3f969oo 5LQ/11NJ43iIePp5vtLM0Fj6GOaL5elnVTgK1QYqoCB+7Qf0LLF0cQ0FpAvp6/gD4P4n 6Ellj6NUe+0+6qetsaNnFbIjtSt/hWvcbeETpgZfLCZ5KuL9SJw8kloro+9Kf5bYFzD3 +dzxe7iUfAuAHDpEwAk9CG+XqZP+qffqRoVtDjKIPcHqw86USFdFq8IR9U5AZYZyROw2 kicvG1asFMzlzuDM+KQNPOzMJmY/BlZSklxiEkqH2bRhNB/n6+0Gjq+H24yCG+ZT4M5L ymPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39-v6si8182158plb.456.2018.04.30.14.09.08; Mon, 30 Apr 2018 14:09:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755200AbeD3VHv (ORCPT + 99 others); Mon, 30 Apr 2018 17:07:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49246 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753522AbeD3VHt (ORCPT ); Mon, 30 Apr 2018 17:07:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C754406C78A; Mon, 30 Apr 2018 21:07:49 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE2D22017F00; Mon, 30 Apr 2018 21:07:48 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w3UL7m9Z013393; Mon, 30 Apr 2018 17:07:48 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w3UL7l5n013389; Mon, 30 Apr 2018 17:07:47 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Mon, 30 Apr 2018 17:07:47 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: John Stoffel cc: Andrew@stoffel.org, eric.dumazet@gmail.com, mst@redhat.com, edumazet@google.com, netdev@vger.kernel.org, jasowang@redhat.com, Randy Dunlap , linux-kernel@vger.kernel.org, Matthew Wilcox , Hocko , James Bottomley , Michal@stoffel.org, dm-devel@redhat.com, David Miller , David Rientjes , Morton , virtualization@lists.linux-foundation.org, linux-mm@kvack.org, Vlastimil Babka Subject: Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options In-Reply-To: <23271.24580.695738.853532@quad.stoffel.home> Message-ID: References: <20180421144757.GC14610@bombadil.infradead.org> <20180424170349.GQ17484@dhcp22.suse.cz> <20180424173836.GR17484@dhcp22.suse.cz> <1114eda5-9b1f-4db8-2090-556b4a37c532@infradead.org> <1524694663.4100.21.camel@HansenPartnership.com> <1524697697.4100.23.camel@HansenPartnership.com> <23266.8532.619051.784274@quad.stoffel.home> <23271.24580.695738.853532@quad.stoffel.home> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 30 Apr 2018 21:07:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 30 Apr 2018 21:07:49 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Apr 2018, John Stoffel wrote: > >>>>> "Mikulas" == Mikulas Patocka writes: > > Mikulas> On Thu, 26 Apr 2018, John Stoffel wrote: > > Mikulas> I see your point - and I think the misunderstanding is this. > > Thanks. > > Mikulas> This patch is not really helping people to debug existing crashes. It is > Mikulas> not like "you get a crash" - "you google for some keywords" - "you get a > Mikulas> page that suggests to turn this option on" - "you turn it on and solve the > Mikulas> crash". > > Mikulas> What this patch really does is that - it makes the kernel deliberately > Mikulas> crash in a situation when the code violates the specification, but it > Mikulas> would not crash otherwise or it would crash very rarely. It helps to > Mikulas> detect specification violations. > > Mikulas> If the kernel developer (or tester) doesn't use this option, his buggy > Mikulas> code won't crash - and if it won't crash, he won't fix the bug or report > Mikulas> it. How is the user or developer supposed to learn about this option, if > Mikulas> he gets no crash at all? > > So why do we make this a KConfig option at all? Because other people see the KConfig option (so, they may enable it) and they don't see the kernel parameter (so, they won't enable it). Close your eyes and say how many kernel parameters do you remember :-) > Just turn it on and let it rip. I can't test if all the networking drivers use kvmalloc properly, because I don't have the hardware. You can't test it neither. No one has all the hardware that is supported by Linux. Driver issues can only be tested by a mass of users. And if the users don't know about the debugging option, they won't enable it. > >> I agree with James here. Looking at the SLAB vs SLUB Kconfig entries > >> tells me *nothing* about why I should pick one or the other, as an > >> example. BTW. You can enable slub debugging either with CONFIG_SLUB_DEBUG_ON or with the kernel parameter "slub_debug" - and most users who compile their own kernel use CONFIG_SLUB_DEBUG_ON - just because it is visible. > Now I also think that Linus has the right idea to not just sprinkle > BUG_ONs into the code, just dump and oops and keep going if you can. > If it's a filesystem or a device, turn it read only so that people > notice right away. This vmalloc fallback is similar to CONFIG_DEBUG_KOBJECT_RELEASE. CONFIG_DEBUG_KOBJECT_RELEASE changes the behavior of kobject_put in order to cause deliberate crashes (that wouldn't happen otherwise) in drivers that misuse kobject_put. In the same sense, we want to cause deliberate crashes (that wouldn't happen otherwise) in drivers that misuse kvmalloc. The crashes will only happen in debugging kernels, not in production kernels. Mikulas