From owner-svn-src-all@freebsd.org Tue Dec 19 10:52:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E47FE9F423; Tue, 19 Dec 2017 10:52:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357CD72B41; Tue, 19 Dec 2017 10:52:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C12D52606D0; Tue, 19 Dec 2017 11:52:45 +0100 (CET) Subject: Re: svn commit: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4 To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711151114.vAFBEeUb015030@repo.freebsd.org> <0100016067e203d1-fa769584-f8a1-44f2-ac39-1572e8fff087-000000@email.amazonses.com> <6d9cacd6-0f98-54e0-86be-6f202f509b17@selasky.org> <010001606bd2747e-d97faaca-1910-41f5-a699-6d015315de9b-000000@email.amazonses.com> From: Hans Petter Selasky Message-ID: Date: Tue, 19 Dec 2017 11:49:57 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <010001606bd2747e-d97faaca-1910-41f5-a699-6d015315de9b-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 10:52:49 -0000 On 12/18/17 23:50, Colin Percival wrote: > On 12/18/17 00:15, Hans Petter Selasky wrote: >> On 12/18/17 05:29, Colin Percival wrote: >>> Also, it breaks some work I have in progress for instrumenting SYSINITs. >>> Would you mind moving the DEFINE_MUTEX line to occur immediately prior to >>> the set_port_type function, rather than being placed inside it? >> >> I'll have a look at this later today. Your point is valid! > > On further examination, it looks like DEFINE_MUTEX is something used in Linux > kernel code, and the way it works there does allow it to be used inside a > function. Is it possible to change the linuxkpi code to make it safe? (It > looks like our mutex initialization is considerably more complicated than > what Linux does, so maybe not...?) Hi, Can you explain what you mean by safe? DEFINE_MUTEX() is simply a wrapper for another SYSINIT. It has nothing to do with the function it is placed inside. > > I have a feeling that we probably don't want to end up in a position of > "every time we import code from Linux, we need to grep for DEFINE_MUTEX > and hoist all of them out of functions". > Can we continue this discussion here: https://reviews.freebsd.org/D13530 --HPS