From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 16 20:39:48 2013 Return-Path: Delivered-To: freebsd-hackers@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 ESMTP id DECDDDC4; Wed, 16 Oct 2013 20:39:48 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-bk0-x236.google.com (mail-bk0-x236.google.com [IPv6:2a00:1450:4008:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 522C22937; Wed, 16 Oct 2013 20:39:48 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id mz12so482987bkb.13 for ; Wed, 16 Oct 2013 13:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=XocITlf+ktEC5TebuJpxrfovcNodeKkg4ACNVlT5lmE=; b=DrULS+7AkDD6BGLWQVg9UnaoAwOMyC/Dq31Ot5nBInHGQOzC7RTlgTIiQG8rYGIcrZ BsV/toZJCBOxjn8uy3kEuWbY4MeNRvz5einh88mE5PEbz+8EDnhb2tJNy6VieegGB5Y0 hqnNmGWxgVFxG0O4F1XvW5sVS3Oe1rEjB5gYV3IbwJhwWkT6ZXd9YHnowHz98Ec5n7h+ 5OtQIBXJokUkn4406gNLWbTXR84KYuiDLIz437CdGRezAr+17l43HqGsO2jMQs47f5En 62Z7eMZCuF2bmFBIk2nF4gZtrzlccFcRGyETnwvtzQBBdA3NfeqEkVWcM7yXy8qpfeMz rLlA== MIME-Version: 1.0 X-Received: by 10.205.22.71 with SMTP id qv7mr4171815bkb.20.1381955986473; Wed, 16 Oct 2013 13:39:46 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.204.100.69 with HTTP; Wed, 16 Oct 2013 13:39:46 -0700 (PDT) In-Reply-To: <1381953459.1168.48.camel@revolution.hippie.lan> References: <1381953459.1168.48.camel@revolution.hippie.lan> Date: Wed, 16 Oct 2013 16:39:46 -0400 X-Google-Sender-Auth: f6rjRar_BYJQSeXkN6CRMPc3ZrE Message-ID: Subject: Re: why does /dev/md call cpu_dcache_flush()? From: Patrick Kelsey To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 20:39:48 -0000 Perhaps it is along the lines of what the comment on most of the implementations suggests: /* * Flush the D-cache for non-DMA I/O so that the I-cache can * be made coherent later. */ void cpu_flush_dcache(void *ptr, size_t len) On a malloc-backed md, servicing a read may result in a D-cache to D-cache transfer if the source and destination buffers are already at least partially in the D-cache. If the originator of the read plans on executing the read data, the I-cache won't find what was just read if part of the read was handled by an intra-D-cache transfer, unless the buffer the data was read into is flushed out to memory first (or I suppose, technically, unless your hardware I-cache happens to check the D-cache also, or they are unified). -Patrick On Wed, Oct 16, 2013 at 3:57 PM, Ian Lepore wrote: > The only caller of cpu_dcache_flush() in the entire system appears to be > the md device. Does anybody know why it makes the call? > > -- Ian > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"