From owner-freebsd-scsi@freebsd.org Mon Jan 16 10:39:07 2017 Return-Path: Delivered-To: freebsd-scsi@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 23946CB0123 for ; Mon, 16 Jan 2017 10:39:07 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A56BA10A5 for ; Mon, 16 Jan 2017 10:39:06 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id r144so168663927wme.1 for ; Mon, 16 Jan 2017 02:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nnMt6KRa6h324EoE99dVfrDcJ3AMMwJ+lwYHwCTyxts=; b=CXX1qhhFUT9U9WFJdnpnNOcFgZKmou18K7UxonXQQa0tBOgmSJJE6d49nuDCUYbfhW FKmXR+IjXBez0Mnz0eJ8QocuV6KSjy5teV3g4sjC0pF4dxVoMq/Q4UMoPMRqTA+DEc8p VfTLugswTzmmvPrYct9gSIGLZpI9moDxJu4ReNZ1yVH9rwhhH75kLQf3fwdZ43KUAVrz DwiLGz9zVKkrTn80njeBa4MZxXMPXF5PYZBGi6kONNPAW/H2PyWRg889FY7cynqZQum/ crrzJF8/VhIoopkPaPcoCCQKoiQJivNlsANv1u5omlQSba8prP4qcNHmM12nHyQHJpty FXRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nnMt6KRa6h324EoE99dVfrDcJ3AMMwJ+lwYHwCTyxts=; b=mL0XpqCzrhNODjTvXTKaZbSg9C1+gTLJLvrzE4oERcg9qxAsIdYAUM/a1IDQZaTIWP diTbHLzlrEFAEz4APEfrh6pf66y9BjrrWNVOtqSEEi1klp+5nTMLjIWEJ/Ai1oJVZuz8 czeiSA7gKBRT1TfrD8IJsf5AJbuw2PDzH7lKVJAQV4aGtH3t/5DaN6iGoyJ/qttr9NPb 5bxE0Tcwpoih4GDspLfPmj0+TZ/z+GKfqohsAKDxa8PYapMR1MNMyAXXPJ4nBrLWzPfs MxwMkmswLBvc3jp5G+Ild3q8Oaaucc621v27r9SIzfEJOwKmkDmDWBBaZUFBNL9+biv2 RARw== X-Gm-Message-State: AIkVDXJ22FEqHO4mswh7uIaHTIB9wca64Izjzr3xnhwoepi1p/lqQ+qgojvAdWX1104ALMfMvwHMeZt1LE9lFA== X-Received: by 10.223.163.30 with SMTP id c30mr1046519wrb.40.1484563144356; Mon, 16 Jan 2017 02:39:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.195.12.46 with HTTP; Mon, 16 Jan 2017 02:39:03 -0800 (PST) In-Reply-To: <3a76c14b-d3a1-755b-e894-2869cd42aeb6@rlwinm.de> References: <20170116071105.GB4560@eureka.lemis.com> <29469.1484559072@critter.freebsd.dk> <3a76c14b-d3a1-755b-e894-2869cd42aeb6@rlwinm.de> From: Aijaz Baig Date: Mon, 16 Jan 2017 16:09:03 +0530 Message-ID: Subject: Re: Understanding the rationale behind dropping of "block devices" To: Jan Bramkamp Cc: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 10:39:07 -0000 Oh thank you everyone for clearing the air a bit. Although for a noob like myself, that was mighty concise! Nevertheless, let me re-iterate what has been summarized in the last two mails so I know I got exactly what was being said. Let me begin that I come from the Linux world where there has traditionally been two separate caches, the "buffer cache" and the "page cache" although almost all IO is now driven through the "page cache". The buffer cache still remains however it now only caches disk blocks ( https://www.quora.com/What-is-the-difference-between-Buffers-and-Cached-columns-in-proc-meminfo-output). So 'read' and 'write' were satisfied through the buffer cache whereas 'fwrite/read', 'mmap' went through the page cache (which was actually populated by reading the buffer cache thereby wasting almost twice the memory and compute cycles). Hence the merging. Nevertheless, as had been mentioned by Julian, it appears that there is no "buffer cache" so to speak (is that correct Julian??) > If you want device M, at offset N we will fetch it for you from the device, DMA'd directly into your address space, but there is no cached copy. Instead it appears FreeBSD has a generic 'VM object' that is used to address myriad entities including disks and as such all operations have to go through the VM subsystem now. Does that also mean that there is no way an application can directly use raw disks? At least it appears so > The added complexity of carrying around two alternate interfaces to the same devices was judged by those who did the work to be not worth the small gain available to the very few people who used raw devices Thank you for all your inputs and waiting to hear more! Al though a bit more context would really help noobs (both to enterprise storage and FreeBSD) like me! On Mon, Jan 16, 2017 at 3:56 PM, Jan Bramkamp wrote: > On 16/01/2017 10:31, Poul-Henning Kamp wrote: > >> -------- >> In message , Julian >> Elischer >> writes: >> >> Having said that, it would be trivial to add a 'caching' geom layer to >>> the system but that has never been needed. >>> >> >> A tinker-toy-cache like that would be architecturally disgusting. >> >> The right solution would be to enable mmap(2)'ing of disk(-like) >> devices, leveraging the VM systems exsting code for caching and >> optimistic prefetch/clustering, including the very primitive >> cache-control/visibility offered by madvise(2), mincore(2), mprotect(2), >> msync(2) etc. >> >> Enabling mmap(2) on devices would be nice, but it would also create > problems with revoke(2). The revoke(2) syscall allows revoking access to > open devices (e.g. a serial console). This is required to securely logout > users. The existing file descriptors are marked as revoked an will return > EIO on every access. How would you implement gracefully revoking mapped > device memory? Killing all those processes with SIGBUS/SIGSEGV would keep > the system secure, but it would be far from elegant. > _______________________________________________ > freebsd-scsi@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" > -- Best Regards, Aijaz Baig