Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212AbcDGD4V (ORCPT ); Wed, 6 Apr 2016 23:56:21 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35450 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755058AbcDGD4S (ORCPT ); Wed, 6 Apr 2016 23:56:18 -0400 Subject: Re: [PATCH v2 10/30] Add x86-specific parity functions To: Andi Kleen , zengzhaoxiu@163.com References: <57031D9D.801@gmail.com> <1459934085-7152-1-git-send-email-zengzhaoxiu@163.com> <87wpoay10o.fsf@tassilo.jf.intel.com> Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, dvlasenk@redhat.com, bp@suse.de, akpm@linux-foundation.org, dvyukov@google.com, keescook@chromium.org, linux-kernel@vger.kernel.org From: Zeng Zhaoxiu Message-ID: <5705DA5C.9020503@gmail.com> Date: Thu, 7 Apr 2016 11:56:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <87wpoay10o.fsf@tassilo.jf.intel.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 919 Lines: 26 ?? 2016??04??07?? 03:45, Andi Kleen ะด??: > zengzhaoxiu@163.com writes: > >> From: Zhaoxiu Zeng >> >> Use alternatives, lifted from arch_hweight > Is there actually anything performance critical in the kernel that uses > parity? > > FWIW the arch hweight custom calling convention is a problem for LTO > because it needs different special flags, so I usually have to disable > it. Likely other reasonable usages, such as automatic source code > analysis, and other tool chain based usages have similar problems. > > As far as I can tell both for hweight and likely for parity it is > badly overengineering and normal calling conventions would work as well, > and cause much less problems. > > So if parity is really worth adding here (which I find doubtful, > but you may have numbers), please add it without these magic > calling hacks. > > -Andi > Thanks. I will instead use __arch_hweight.