From owner-svn-src-projects@FreeBSD.ORG Fri Aug 16 13:10:50 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6F756CD9; Fri, 16 Aug 2013 13:10:50 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x229.google.com (mail-ea0-x229.google.com [IPv6:2a00:1450:4013:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDB1925CA; Fri, 16 Aug 2013 13:10:49 +0000 (UTC) Received: by mail-ea0-f169.google.com with SMTP id z7so1007893eaf.28 for ; Fri, 16 Aug 2013 06:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vmX0TQkXkWxzpd3UAQeKgcFL2bwtgUOuohF8WYRyXII=; b=y4CHhDv8LEtsuV1ENceA/6sM0i51jiCOx8c0r/62AQxcpTkvUVOX9hQDh+SlDmlvss 0vAdwY3XZKuroAEtfm1vmsMr87gczvNk9US+YaXhMWFsps4llP6hzJ0bUyn1ikHOBoUa vzeMw/2bhXYtbQUzCnX+TlLE4lg+XwDO6v9VCYAAErLbdnVeOnlWor9q0ONKmF16O0nX cnGyxQiGJm8QJTwvOBID4Kx08cv5UtWHoKPT49JdQcp+JcBIkZ9q3dsx3p2Zo6TMVIz0 lRZvk6a5lioCqu9ya6xABHBacDgJZKw8i2sg/e4J6vk87+CkfRrEf94bETTZTsK86HpQ 1FeQ== X-Received: by 10.15.63.75 with SMTP id l51mr2043791eex.32.1376658648085; Fri, 16 Aug 2013 06:10:48 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([37.229.21.195]) by mx.google.com with ESMTPSA id r48sm2557003eev.14.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 06:10:46 -0700 (PDT) Sender: Alexander Motin Message-ID: <520E24D4.2040606@FreeBSD.org> Date: Fri, 16 Aug 2013 16:10:44 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r254408 - in projects/camlock/sys: cam/ata cam/scsi dev/md geom References: <201308161225.r7GCP3EW061762@svn.freebsd.org> <20130816130503.GC4972@kib.kiev.ua> In-Reply-To: <20130816130503.GC4972@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2013 13:10:50 -0000 On 16.08.2013 16:05, Konstantin Belousov wrote: > On Fri, Aug 16, 2013 at 12:25:03PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Fri Aug 16 12:25:02 2013 >> New Revision: 254408 >> URL: http://svnweb.freebsd.org/changeset/base/254408 >> >> Log: >> Make first steps toward direct BIO dispatch in GEOM: >> - Define flags, declaring that specific consumer/provider is capable of >> sending requests/replies (respectively) directly, i,e. doesn't hold any locks >> and so reenterable, and/or able to directly receive replies/requests, i.e. >> doesn't depend on GEOM up/down threads semantics. As result, GEOM will make >> direct calls only if both caller and callee are cpable of it in each case. >> - Define disk(9) flag to declare that disk is capable of direct request >> completion, and use it for da(4) and ada(4) drivers. Make GEOM DISK to pass >> that flag to its provider and also assume that any disk is capable of >> receiveing requests directly. >> - Mark GEOM DEV as capable of both direct send and receive. >> - Make md(4) declare both direct send and receive after adding mutex to >> serialize its statistics update on request path. > > I do not think it is safe to allow the mdstart_malloc() to execute in > parallel with itself. It certainly causes data corruption for the new > block allocations on write, and possibly random kernel memory corruption. > > It seems that vnode and swap backends are safe, though. md(4) runs all of its main code in separate thread. So this change only affects how to pass requests from GEOM to that thread. I had no plans to work on md(4) specifically, so if somebody else wish to make it run without using single separate thread per instance -- that would boost its performance many times more. -- Alexander Motin