Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp764035imu; Fri, 25 Jan 2019 10:31:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XsQ2UdOuqW2KGk84E4IDjy5PC4tl79IeKRFzSlfY54amLuQ0VUBKdFzXRxosEYW35iR8b X-Received: by 2002:a17:902:981:: with SMTP id 1mr11800281pln.142.1548441095912; Fri, 25 Jan 2019 10:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548441095; cv=none; d=google.com; s=arc-20160816; b=z4ksAutzS3nnhZPv2zvI5m3KG4Wv1qOSDc6Pm04IZm1hG+NTe7UOv0yGW3ueSi3gAV rpQCAG22nwY+aEuK5Q131TVy7V3FveM6WxVV4S5CtHoC5Sefc1vm/ts7GqhMWnEWTImz eKzvOEdQ40S0z2HmasO7ZD+gIOeQNG7GL3pd2fP2k/Rl2/La3UqaUxNp44YX2qCddBRq 9yfkwmzMctZwrOkDzDuf0LqDpuGM231QcRGG7Di5gl//DHkbUm5ZRXBJTrISf2Wma9e+ h/zhAmLPADqOi0/Dveh64ZwrzJxppaAq9sYIPUILUVZaouqJmTf4vWllwg1VbyccCGkN ektA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6Hd0xLUBccaWgZV4P39EiAtUCWkkIREEP9KA/fKQb64=; b=XO0YeGx1q15nwP87NPRsNjr8Rj7txj3m28L+HXFluvMUr8VDphaB2hnmxDy0KxmIhm CxfovEyLHAvNQq+lFezeivXLX7Nx3qXRcm4lISEAGV0JGlp5XwMpgRSmxfDIkcddaDSc aoPqLpTiyz4AoVTY8DZwVO8FA7uWqz/u8hevr1gAMCFLlKXSLsQo1YB1cm5KOxyGRAkG MBnC5lPOB4qRsyvHXZbIrd5SFsYQX/0hutC+FtoOnTmvIgexImTxZJyWZMtPlS92U/xk hm/qJANzY9ZiS0YLOjxfJYsY7Dz8j6sF2lnA9dDSTVDEOTAj4bS+XoTDdHrRGOw9+ao9 fQGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cYyvijAG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g187si24493048pfc.43.2019.01.25.10.31.20; Fri, 25 Jan 2019 10:31:35 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=cYyvijAG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728536AbfAYS3s (ORCPT + 99 others); Fri, 25 Jan 2019 13:29:48 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:34458 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfAYS3s (ORCPT ); Fri, 25 Jan 2019 13:29:48 -0500 Received: by mail-yw1-f66.google.com with SMTP id g75so4298825ywb.1 for ; Fri, 25 Jan 2019 10:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Hd0xLUBccaWgZV4P39EiAtUCWkkIREEP9KA/fKQb64=; b=cYyvijAGASiLQVyPaNpKFnF+PPk5Ak4IISWNTvNC0A+4XaScUwAxncoLJJt0EWPxPj JLbAjcfriwUpE7PN1klrcf31c8HSqTmV6ZUo3ewZMv+gpph/HaLsBXY6Unbsu9UUIPpe CEgkaC/zfy845JK2L7vqsXtA5VhBh/3jXiAOWlAwBhPr5nWYlvIv+5tWq8IMpZhsjt0v EY2ZCmJD54SOPq3OuhDiLDhqcf5C3xbwM8D9lMVQXIARpmPdhK38xWKmqdl6B0YuyIZ3 kxm0F9SVScwgprRnyn5v/JkKdIpA/cK5yIfMvU4nG3Ibl5SpqIJZ68mRjYBzB8naubOX 6SQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Hd0xLUBccaWgZV4P39EiAtUCWkkIREEP9KA/fKQb64=; b=i9+Wk8LkG8rCC7U0dCPsKOav181Miij6vaf0A/YsZ7knMNzk5WqZ650rQhWdoNIVhz 8PMLDUVSyYQUZvpT6BGfVJ03YwZf3vJIh0swVOqv6LDf7eG/qFASf7vkmtBcIrvBvE4A MlM91ga69c8XhFR91MxrAjcEFFNhdkeyc27Gen967k/j7lasrq0Kf/um0uENcoz/CbTy QRJSOrkJapNzeOfO0wMqFMRm/hejrkbFHr1A66V9IU14QD8nbCui840/CZq8KqIj8QHO svpWv7wIR/Qo7CVUI0DtcdgnxUfCS+LQF223/1DkivUVQ7vA6PuRheejkRgcZAq4S043 P8aA== X-Gm-Message-State: AJcUukeVkBO6luxqzZZ8TMYuXgGRcpoWsvRXDKyL7tnv9SPg9Q7cnVor xKmuralTl+OXOwSyOYMCbdwCvKfuYnlxN/FOZ18tpfy+ X-Received: by 2002:a0d:ea81:: with SMTP id t123mr12004415ywe.496.1548440987410; Fri, 25 Jan 2019 10:29:47 -0800 (PST) MIME-Version: 1.0 References: <20190125025747.1853-1-jcmvbkbc@gmail.com> In-Reply-To: From: Max Filippov Date: Fri, 25 Jan 2019 10:29:35 -0800 Message-ID: Subject: Re: [PATCH] treewide: get rid of HAVE_FUTEX_CMPXCHG To: Geert Uytterhoeven Cc: LKML , Andy Lutomirski , Arnd Bergmann , Paul Burton , Ralf Baechle , Thomas Gleixner , Greg Ungerer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, > > --- a/arch/m68k/Kconfig > > +++ b/arch/m68k/Kconfig > > @@ -20,7 +20,6 @@ config M68K > > select GENERIC_STRNLEN_USER if MMU > > select ARCH_WANT_IPC_PARSE_VERSION > > select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE > > - select HAVE_FUTEX_CMPXCHG if MMU && FUTEX > > I guess it didn't really matter for !MMU? I see that m68k uses generic futex.h, which doesn't depend on MMU vs noMMU. > > --- a/include/asm-generic/futex.h > > +++ b/include/asm-generic/futex.h > > @@ -136,6 +136,8 @@ arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr) > > return ret; > > } > > > > +#define arch_have_futex_cmpxchg() (0) > > This is for the SMP=y case only, right? Yes, that's where generic implementation always returns -ENOSYS > > --- a/kernel/futex.c > > +++ b/kernel/futex.c > > @@ -174,7 +174,11 @@ > > * double_lock_hb() and double_unlock_hb(), respectively. > > */ > > > > -#ifdef CONFIG_HAVE_FUTEX_CMPXCHG > > +/* > > + * Architectures should define this macro if futex_atomic_cmpxchg_inatomic() > > + * may not be always working. > > + */ > > +#ifdef arch_have_futex_cmpxchg > > Shouldn't this be #ifndef now... Oops, thank you. I thought I've build-tested both cases, but I obviously haven't... > > @@ -3880,7 +3864,9 @@ static int __init futex_init(void) > > futex_hashsize, futex_hashsize); > > futex_hashsize = 1UL << futex_shift; > > > > - futex_detect_cmpxchg(); > > +#ifdef arch_have_futex_cmpxchg > > + futex_cmpxchg_enabled = arch_have_futex_cmpxchg(); > > ... else you're assigning to the constant: > > error: lvalue required as left operand of assignment Will send v2... -- Thanks. -- Max