From owner-freebsd-arch@FreeBSD.ORG Sat Feb 25 13:01:34 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AB0106564A; Sat, 25 Feb 2012 13:01:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id BF4928FC0C; Sat, 25 Feb 2012 13:01:33 +0000 (UTC) Received: by lagz14 with SMTP id z14so5424826lag.13 for ; Sat, 25 Feb 2012 05:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=SEoxNxGnZT1w8j87qoxtutrOoOj9OePdjTJ2I+vL6F4=; b=sSipndwfEl0UjGJ2cSgxSX3m8O1ZJ46dedB1IAwRScAFFjpmiq+0wXjxWmwz4hD9t2 CYbi1WsOEZ2xjMCVoGeQdpG9vdEzGrnwFk6xvnNI7Q4hBri5GCM9KM2t1PqG8ZHYar4T G5L2OqadxtwqvgMA24aa9yel+YrbKjIxEqULw= MIME-Version: 1.0 Received: by 10.112.10.41 with SMTP id f9mr2200298lbb.8.1330174892478; Sat, 25 Feb 2012 05:01:32 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.41.5 with HTTP; Sat, 25 Feb 2012 05:01:32 -0800 (PST) In-Reply-To: <20120203193719.GB3283@deviant.kiev.zoral.com.ua> References: <20120203193719.GB3283@deviant.kiev.zoral.com.ua> Date: Sat, 25 Feb 2012 13:01:32 +0000 X-Google-Sender-Auth: AIz5d3RDFZnnVRbqo_8cufNFnfs Message-ID: From: Attilio Rao To: Konstantin Belousov , Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Cc: arch@freebsd.org Subject: Re: Prefaulting for i/o buffers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2012 13:01:34 -0000 Il 03 febbraio 2012 19:37, Konstantin Belousov ha scritto: > FreeBSD I/O infrastructure has well known issue with deadlock caused > by vnode lock order reversal when buffers supplied to read(2) or > write(2) syscalls are backed by mmaped file. > > I previously published the patches to convert i/o path to use VMIO, > based on the Jeff Roberson proposal, see > http://wiki.freebsd.org/VM6. As a side effect, the VM6 fixed the > deadlock. Since that work is very intrusive and did not got any > follow-up, it get stalled. > > Below is very lightweight patch which only goal is to fix deadlock in > the least intrusive way. This is possible after FreeBSD got the > vm_fault_quick_hold_pages(9) and vm_fault_disable_pagefaults(9) KPIs. > http://people.freebsd.org/~kib/misc/vm1.3.patch Hi, I was reviewing: http://people.freebsd.org/~kib/misc/vm1.11.patch and I think it is great. It is simple enough and I don't have further comments on it. However, as a side note, I was thinking if we could get one day at the point to integrate rangelocks into vnodes lockmgr directly. It would be a huge patch, rewrtiting the locking of several members of vnodes likely, but I think it would be worth it in terms of cleaness of the interface and less overhead. Also, it would be interesting to consider merging rangelock implementation in ZFS' one, at some point. BTW, nice job! Attilio -- Peace can only be achieved by understanding - A. Einstein