Received: by 10.192.165.148 with SMTP id m20csp2512416imm; Thu, 26 Apr 2018 12:15:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KWfkbEjcdjONzsj0tHtnCY2h4CG9A02+TpIQlC+gQiyq2Frl0eRlCxmyM5+kVZGuZlrLQ X-Received: by 10.98.56.144 with SMTP id f138mr33760201pfa.173.1524770147992; Thu, 26 Apr 2018 12:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524770147; cv=none; d=google.com; s=arc-20160816; b=zo0/3B5a1m3fOeZy2HhFYZsTBPNY6OypeTAbsy6+lYKtjy3Vdx0sBC3scQ90larq+B pD2d97bb/czZ4iCXhV9UN11Pt6z+T9xEraSAwAjLJM8OKB6ZUwOF3b33J6wRTlQ740a3 IK3HyaLc5hreafucUMQvWQ1B8MRPy0ovTwBJZqDCGa8PceAQUTg8PMk7eT+EZsFhIXQR Ep9GY1YWDT4Rio+Djd/lhOmrX3bVXFYbfyl8bbJLZ8nWRc52pdNG96E4uuPcdSb7zUm1 QGj2Q58fEcFonIQoDxwcQWWpnjUisTyEXuTwhX11b5Fuayu5Wn37NFY986dmu2dWQcrt lPdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=sSG0W/+N/FxAIIA25Fu31u8BBPWVSwLxulNatw7g93I=; b=pfbM7kdmujCFYIOX9pXR0lk5cLrrssja58SNd5AiO4K6fDEluOWaeiyyWlFsoWW5yo Sgp37XOD5Y59PxnsDbu3JHNF+qLl3y/b80QMffiVEb7tet0JdawZvdSf7rpy6JHusLNg IQrkB1lI2UrizVVnHBnd87K9upCkYurtaATkjoViXhpcsxQULYyPh3oH5KvKVvto9mjT QbsnVMosBM0wmiDLTXRHzHs4zs7ciagAIgSfbSajoZCDJCicsU7nBSzOTO8eMenmskrs 1Kywxh227VOZwxnDl8ROIKcDV5WIF4Hyi06zL7V1P7cUA/NXGCSnGknSEgIq81cLrtyJ W8hg== 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 90-v6si13257521plc.205.2018.04.26.12.15.33; Thu, 26 Apr 2018 12:15:47 -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 S1754840AbeDZTOZ (ORCPT + 99 others); Thu, 26 Apr 2018 15:14:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753836AbeDZTOV (ORCPT ); Thu, 26 Apr 2018 15:14:21 -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 55FC48DC4F; Thu, 26 Apr 2018 19:14:20 +0000 (UTC) Received: from redhat.com (ovpn-123-156.rdu2.redhat.com [10.10.123.156]) by smtp.corp.redhat.com (Postfix) with SMTP id 63AE32022EE7; Thu, 26 Apr 2018 19:14:19 +0000 (UTC) Date: Thu, 26 Apr 2018 22:14:19 +0300 From: "Michael S. Tsirkin" To: Mikulas Patocka Cc: James Bottomley , Michal Hocko , David Rientjes , dm-devel@redhat.com, eric.dumazet@gmail.com, netdev@vger.kernel.org, jasowang@redhat.com, Randy Dunlap , linux-kernel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, edumazet@google.com, Andrew Morton , virtualization@lists.linux-foundation.org, David Miller , Vlastimil Babka Subject: Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options Message-ID: <20180426220523-mutt-send-email-mst@kernel.org> References: <20180426125817.GO17484@dhcp22.suse.cz> <1524753932.3226.5.camel@HansenPartnership.com> <1524756256.3226.7.camel@HansenPartnership.com> <20180426184845-mutt-send-email-mst@kernel.org> <20180426214011-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.2]); Thu, 26 Apr 2018 19:14:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 26 Apr 2018 19:14:20 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 02:54:26PM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > > > IIUC debug kernels mainly exist so people who experience e.g. memory > > > > corruption can try and debug the failure. In this case, CONFIG_DEBUG_SG > > > > will *already* catch a failure early. Nothing special needs to be done. > > > > > > The patch helps people debug such memory coprruptions (such as using DMA > > > API on the result of kvmalloc). > > > > That's my point. I don't think your patch helps debug any memory > > corruptions. With CONFIG_DEBUG_SG using DMA API already causes a > > BUG_ON, that's before any memory can get corrupted. > > The patch turns a hard-to-reproduce bug into an easy-to-reproduce bug. It's still not a memory corruption. It's a BUG_ON the source of which - should it trigger - can be typically found using grep. > Obviously we don't want this in production kernels, but in the debug > kernels it should be done. > > Mikulas I'm not so sure. debug kernels should make debugging easier, definitely. Unfortunately they are already slower so some races don't trigger. If they also start crashing more because we are injecting memory allocation errors, people are even less likely to be able to use them. Just add a comment near the BUG_ON within DMA API telling people how they can inject this error some more if the bug does not reproduce, and leave it at that. -- MST