From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805Ab0LUXZk (ORCPT ); Tue, 21 Dec 2010 18:25:40 -0500 Received: from terminus.zytor.com ([198.137.202.10]:53233 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753465Ab0LUXZj (ORCPT ); Tue, 21 Dec 2010 18:25:39 -0500 Message-ID: <4D11373D.9010205@zytor.com> Date: Tue, 21 Dec 2010 15:24:45 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: Christoph Lameter CC: Tejun Heo , akpm@linux-foundation.org, Pekka Enberg , linux-kernel@vger.kernel.org, Eric Dumazet , Mathieu Desnoyers Subject: Re: [cpuops cmpxchg double V1 1/4] Generic support for this_cpu_cmpxchg_double References: <20101214174847.887713690@linux.com> <20101214174900.058235985@linux.com> <4D0CC982.3030905@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/2010 02:36 PM, Christoph Lameter wrote: > On Sat, 18 Dec 2010, Tejun Heo wrote: > >> pointers from the beginning. Anyways, that's too late, so is it >> completely impossible to make cmpxchg_double's take a scalar value? >> It can take the pointer all the same, no? > > It could take a scalar value like the others but we are then not operating > on the scalar alone but also on the following field. > I'm a bit confused on this one. The standard cmpxchg() takes a scalar and a pointer, and returns a scalar. The equivalent for the "double" variety would be to return a compound object, basically: struct double_ulong { unsigned long v[2]; }; ... which can be returned in registers on both i386 and x86-64. It's a bit clumsy from a type perspective, but I'm not sure that that is a bad thing. Doing too much type genericity has caused us problems in the past. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.