Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2773229imm; Mon, 10 Sep 2018 06:21:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbF2MTTf4C6Oqw2mDhUSCrGD1x9PLPHjyEVH7elUDExuWYQNUYV4gilxhAV0+5kVZKBhBx6 X-Received: by 2002:a17:902:4906:: with SMTP id u6-v6mr21724730pld.44.1536585661469; Mon, 10 Sep 2018 06:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536585661; cv=none; d=google.com; s=arc-20160816; b=DzvehsBMtY8pAQ3QGgJZ9SQBSBKXhenWS+6NOu+vYdlJ91I/Dxx3kIaWo+Eystaqi9 zOdPQUWInlmk/sYofTRJeZn6QyI3OpLPxELjqb/FRpsr3sjcZ5Bu3zeKf3CzKdWr+hMd pUzHvWGQPWXtYP+EWK5AeHcqqctBqN1pgIHORGlmKIcky/BdQagQOTLBLwa1hDriGYfs PIpd8KnTlnwY1jzyekc091h6iGYn43uJMnAOrzH7QG7ZI45Bzm5QvNk0JhiNOjPfcHyF Wq7XilboBfu3UHMJprhkkmHuWKMUCEoQmsnYFWTabe2gf96kk0UkYs7kXEFIK0nkdic/ U5AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Xu8ciilrk7ZUVKPh8CUy46PnshhIPmddPuu0CGGW+0M=; b=IxQ6phoJL16AwMXxcmUFu92pEf57xNw1F4EAz11cLlgDQnKbwMHY2dF42MOoksLRW8 wRQZ15RjyYnxVZoy86S5F10b5MAdhAvaQ7hOvaTdaY/y33wfSYSA9Su5bJ0IS3R9qutY vD4alA4kK2eAMxqeyUJmbb0IoqLDpTwjT+RNM9eRejdS9/slPJ77CEBZUQygc1kDUqZK B3fCJONUv0QaJVA2gFeL49ZjBFy1Hk7Ebp2ODRTUR8h9209LucUjPf9qpY4wEiZbkzs0 eX/vOzo7YoGAKyohdO7wGSG7Pirp4YhoLz0bT0NWJgsOhmdeFKmaVKi1jOm5DaT+0a8y HYrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GNv+9FV5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t32-v6si16789095pgl.484.2018.09.10.06.20.46; Mon, 10 Sep 2018 06:21:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GNv+9FV5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbeIJSMI (ORCPT + 99 others); Mon, 10 Sep 2018 14:12:08 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34197 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeIJSMH (ORCPT ); Mon, 10 Sep 2018 14:12:07 -0400 Received: by mail-wr1-f68.google.com with SMTP id g33-v6so21944274wrd.1 for ; Mon, 10 Sep 2018 06:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Xu8ciilrk7ZUVKPh8CUy46PnshhIPmddPuu0CGGW+0M=; b=GNv+9FV5vWv/8s4yuyYpU4Hv5ws0adk3iF3svqq2J3o9SjytucAAzrPRzZdfeJ2uer lN8D8IfEMk9Ewxl3z60Llr3jRwkcFCbF0Qbd1k26RgkSqpV+hjOCQ1LRwqRIWny5HTnj SB211bfEzBoDsNXWpSjH+V3bo6oBq9uKOzefKG/eCKIyNqgl53OJEGbZkwRsTjn3pQfA sO48DAASRLCkSOGv1XvKBX23agKc6Hd7hMEVdQnl8n0MCVsJsArvmbd9x+qOvFrDcCJq +FQa1B5SGZe7F9GFJpERtuKVag6G9v8RkImsYB02fT37e6SWJRgdxBGcdb5cvUhaze7E 0P3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Xu8ciilrk7ZUVKPh8CUy46PnshhIPmddPuu0CGGW+0M=; b=QQ5VRN/hpOjVQx7CrwdXVuX7KvJlo74t0k0cDGtjESH+vXVPcFUf9WECud4UXtDzFB o/YTDTBD4yGfN41bzfUdpo1BMUkqi01uDZrdWiXVtI6vg/KCxS3lsbKfUlmI76D7PjF5 gaOhKLK8fl9A7j0ObIivmrPLZb2ZS+Hum6oqLu73CxglqV3jusmLs9v3HmDp8zmojQiz oCYJeECiUJhevo/ffROdwW4FgcnoQ0EBEyUxbVDnx9Rmwu5jz36llDXb9a/B6FDRj1K8 24tVHx8KfviG0J+hLPWejMnkh3JzBIfqCloASI90wvt6uZEsAgqHCgJcbSMRmld6z9KM l5jw== X-Gm-Message-State: APzg51BdCrl73Ld+q0RFd7UD4MQbnC7NWu2vse9Z8VCAmYlHtOk6P28U w/z3pHlgBCOeMY3yxEREtRQ= X-Received: by 2002:adf:ed88:: with SMTP id c8-v6mr14994712wro.264.1536585483419; Mon, 10 Sep 2018 06:18:03 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id p11-v6sm17647055wrd.74.2018.09.10.06.18.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 06:18:02 -0700 (PDT) Date: Mon, 10 Sep 2018 15:18:00 +0200 From: Ingo Molnar To: Mikulas Patocka Cc: Mike Snitzer , Thomas Gleixner , Dan Williams , device-mapper development , X86 ML , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 RESEND] x86: optimize memcpy_flushcache Message-ID: <20180910131800.GA41487@gmail.com> References: <20180519052503.325953342@debian.vm> <20180519052631.730455475@debian.vm> <20180524182013.GA59755@redhat.com> <20180618132306.GA25431@redhat.com> <20180621143140.GA14095@gmail.com> <20180622013049.GA12505@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mikulas Patocka wrote: > Here I resend it: > > > From: Mikulas Patocka > Subject: [PATCH] x86: optimize memcpy_flushcache > > I use memcpy_flushcache in my persistent memory driver for metadata > updates, there are many 8-byte and 16-byte updates and it turns out that > the overhead of memcpy_flushcache causes 2% performance degradation > compared to "movnti" instruction explicitly coded using inline assembler. > > The tests were done on a Skylake processor with persistent memory emulated > using the "memmap" kernel parameter. dd was used to copy data to the > dm-writecache target. > > This patch recognizes memcpy_flushcache calls with constant short length > and turns them into inline assembler - so that I don't have to use inline > assembler in the driver. > > Signed-off-by: Mikulas Patocka > > --- > arch/x86/include/asm/string_64.h | 20 +++++++++++++++++++- > arch/x86/lib/usercopy_64.c | 4 ++-- > 2 files changed, 21 insertions(+), 3 deletions(-) Applied to tip:x86/asm, thanks! I'll push it out later today after some testing. Thanks, Ingo