From owner-freebsd-arch@FreeBSD.ORG Thu Sep 25 07:46:59 2014 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0D79B8E; Thu, 25 Sep 2014 07:46:59 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF85131; Thu, 25 Sep 2014 07:46:58 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8P7krrW030761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Sep 2014 10:46:53 +0300 (EEST) (envelope-from kostik@tom.home) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8P7krrW030761 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8P7krJD030760; Thu, 25 Sep 2014 10:46:53 +0300 (EEST) (envelope-from kostik) Date: Thu, 25 Sep 2014 10:46:53 +0300 From: Konstantin Belousov To: Bryan Drewery Subject: Re: KASSERT_WARN for asserting malloc(M_WAITOK) not in a non-sleepable thread Message-ID: <20140925074653.GP8870@kib.kiev.ua> References: <54236CD6.4050807@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54236CD6.4050807@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 07:46:59 -0000 On Wed, Sep 24, 2014 at 08:16:06PM -0500, Bryan Drewery wrote: > By the way, it was mentioned to me that the interrupt assert may be > wrong but from my understanding the thread is in an interrupt context if > td_intr_nesting_level>0, so the check seems fine to me. It is wrong not due to the test for the interrupt level, but because you must not call malloc(9) from the interrupt context at all, regardless of flags. At very least, it causes recursion on the malloc/uma locks, but also it should damage the uma state.