From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753522AbbCLLJ7 (ORCPT ); Thu, 12 Mar 2015 07:09:59 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:46121 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbbCLLJz (ORCPT ); Thu, 12 Mar 2015 07:09:55 -0400 Date: Thu, 12 Mar 2015 12:09:51 +0100 From: Ingo Molnar To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Dan Williams , Borislav Petkov Subject: Re: [PATCH] x86: improve algorithm in clflush_cache_range Message-ID: <20150312110950.GA8475@gmail.com> References: <1426107899-27933-1-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426107899-27933-1-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ross Zwisler wrote: > The current algorithm used in clflush_cache_range() can cause the last > cache line of the buffer to be flushed twice. > > Fix that algorithm so that each cache line will only be flushed once, > and remove arithmetic on void pointers. Void pointer arithmetic is > allowed by GCC extensions, but isn't part of the base C standards. The optimization itself is fine, but that last argument is bogus: the Linux kernel very much relies on 'void *' arithmetics in a gazillion places. Thanks, Ingo