From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26003 invoked by alias); 19 Aug 2013 23:48:49 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 25968 invoked by uid 89); 19 Aug 2013 23:48:48 -0000 X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_NEUTRAL autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients Received: from popelka.ms.mff.cuni.cz (HELO popelka.ms.mff.cuni.cz) (195.113.20.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 19 Aug 2013 23:48:47 +0000 Received: from domone.kolej.mff.cuni.cz (popelka.ms.mff.cuni.cz [195.113.20.131]) by popelka.ms.mff.cuni.cz (Postfix) with ESMTPS id 41D865043F; Tue, 20 Aug 2013 01:48:43 +0200 (CEST) Received: by domone.kolej.mff.cuni.cz (Postfix, from userid 1000) id 196FA60135; Tue, 20 Aug 2013 01:48:42 +0200 (CEST) Date: Mon, 19 Aug 2013 23:48:00 -0000 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: tudorb at gmail dot com Cc: glibc-bugs@sourceware.org Subject: Re: [Bug libc/12518] memcpy acts randomly (and differently) with overlapping areas Message-ID: <20130819234842.GA7823@domone.kolej.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-08/txt/msg00093.txt.bz2 On Mon, Aug 12, 2013 at 05:19:54PM +0000, tudorb at gmail dot com wrote: > --- Comment #28 from Tudor Bosman --- > FYI, this bug has bitten me in a different way: memcpy() copying backwards > defeats the MADV_SEQUENTIAL flag to madvise(). A trivial file copier > implementation (mmap source, mmap destination, set MADV_SEQUENTIAL, memcpy from > source to destination) would perform much worse on machines that support SSSE3 > than on machines that don't because of this bug. > Wait, do you have overlapping source and destination areas? If so then a backward copy is necessary. Or is backward copy called for not overlapping areas? I have a patch that could call backward copy only if src-n < dest < src+n holds. > (Before anyone tells me that I should copy files using read() and write(), my > actual usage pattern was more complex, but the details are irrelevant.) > > -- > You are receiving this mail because: > You are on the CC list for the bug.