Received: by 10.192.165.148 with SMTP id m20csp4888962imm; Tue, 24 Apr 2018 10:01:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49zf5bopNvZQa0x5wJ6saJdqvxQjQSgX/Z2I2AkWaGTpEeIiEWayPYTU8ntUQUPwC8BCabE X-Received: by 10.99.98.66 with SMTP id w63mr20431152pgb.377.1524589304389; Tue, 24 Apr 2018 10:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524589304; cv=none; d=google.com; s=arc-20160816; b=d7z9tN8Oz2FAmLBeeoGAe9R2arcKW57jLuQJ0IDipFpy6VZUemuPGaupPX4ULh/KGH +0N6+qv0sPTGJM9S+b2bPKV0I0BptXevhCcxUY/+maUk+03wONQmdf9NjCMDIcDVPTEh C2m3JDALXZacSoVUBG7T1MppSTnQJaguieGR59l8uG3FODJzK1zFagkzujUmOz7bkRly eAJK7DsgUeLZzMFOHppe9jFigIhXMHvLJX92R5qsQgJijXjEbls/OzAkvbxOLE5R7Q/5 suWBPwVE43BC9dd2IOYXawZvqseEZIrMl7kjpeCOPBXHd/xMraHuTUvuO+4+G4a6IHh+ 7/Fg== 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=7S1Fi5sdIjVM1OP+WPEUJ3WTCOjkWF8e9B9ChBMn6Wg=; b=cdBZG1vZ0r5S+crJgUEqZppVi9H/bbYyKjlG5tXDktjm6r7pd+kUgFkWRmeTPgpSRQ Ihjv6TxHfLKIcomVaW58tuXgkksmY59BCt4vwYqpc4wuSAAvtglEqFqUuhbeG/NtKeiN buUZUSsINvNnUclfS0jkBUlTfVgZ7EzawenWMoQPp99qRk2QbPD58L6U5KCZPsSEFqfK ZJOsjFDiGmIHuOb+8p3GIbf7rOOx9XQEObW3m414BOtpmOXoHzgv+bZdeXNX1BzTdacX Xv8Qps4TLbTH0d3uTf4yQ6ZtIiHgtLc6iGIH2oykss7Qd5ZQ//NCg658hyOor7nJCr1E TLqQ== 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 i27si13403291pfa.219.2018.04.24.10.01.29; Tue, 24 Apr 2018 10:01:44 -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 S1751401AbeDXRAT (ORCPT + 99 others); Tue, 24 Apr 2018 13:00:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751047AbeDXRAQ (ORCPT ); Tue, 24 Apr 2018 13:00:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8EE7A2CCF; Tue, 24 Apr 2018 17:00:15 +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 710A710F1C00; Tue, 24 Apr 2018 17:00:11 +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 w3OH0BuH030799; Tue, 24 Apr 2018 13:00:11 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w3OH0BSB030794; Tue, 24 Apr 2018 13:00:11 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 24 Apr 2018 13:00:11 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Michal Hocko cc: Matthew Wilcox , David Miller , Andrew Morton , linux-mm@kvack.org, eric.dumazet@gmail.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, dm-devel@redhat.com, Vlastimil Babka Subject: Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG In-Reply-To: <20180424162906.GM17484@dhcp22.suse.cz> Message-ID: References: <20180420130852.GC16083@dhcp22.suse.cz> <20180420210200.GH10788@bombadil.infradead.org> <20180421144757.GC14610@bombadil.infradead.org> <20180423151545.GU17484@dhcp22.suse.cz> <20180424125121.GA17484@dhcp22.suse.cz> <20180424162906.GM17484@dhcp22.suse.cz> 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.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 24 Apr 2018 17:00:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 24 Apr 2018 17:00:15 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Tue, 24 Apr 2018, Michal Hocko wrote: > On Tue 24-04-18 11:50:30, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Mon 23-04-18 20:06:16, Mikulas Patocka wrote: > > > [...] > > > > @@ -404,6 +405,12 @@ void *kvmalloc_node(size_t size, gfp_t f > > > > */ > > > > WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL); > > > > > > > > +#ifdef CONFIG_DEBUG_SG > > > > + /* Catch bugs when the caller uses DMA API on the result of kvmalloc. */ > > > > + if (!(prandom_u32_max(2) & 1)) > > > > + goto do_vmalloc; > > > > +#endif > > > > > > I really do not think there is anything DEBUG_SG specific here. Why you > > > simply do not follow should_failslab path or even reuse the function? > > > > CONFIG_DEBUG_SG is enabled by default in RHEL and Fedora debug kernel (if > > you don't like CONFIG_DEBUG_SG, pick any other option that is enabled > > there). > > Are you telling me that you are shaping a debugging functionality basing > on what RHEL has enabled? And you call me evil. This is just rediculous. > > > Fail-injection framework is if off by default and it must be explicitly > > enabled and configured by the user - and most users won't enable it. > > It can be enabled easily. And if you care enough for your debugging > kernel then just make it enabled unconditionally. So, should we add a new option CONFIG_KVMALLOC_FALLBACK_DEFAULT? I'm not quite sure if 3 lines of debugging code need an extra option, but if you don't want to reuse any existing debug option, it may be possible. Adding it to the RHEL debug kernel would be trivial. Mikulas