Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp866300pxb; Tue, 14 Sep 2021 10:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYghU7TYp6f6fsbeFbNbxA9qU+B0ysUywtPqMnepxr7FN8vKbVCjJ/6VCiNMBYJQ/wT2BY X-Received: by 2002:ac2:5e75:: with SMTP id a21mr12029493lfr.557.1631640094852; Tue, 14 Sep 2021 10:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631640094; cv=none; d=google.com; s=arc-20160816; b=jLeUxruHSPLTgMg0GZWavMERDgJzh1OjrIFpzPSRgIUqoZamFW+70OjcgxYbdveB3Y BS/LvTtddhEGaCousjkUyTRlY51qFUyt3Fipg275xOGlbFa19ToIOJwA08uUKjPBEliN 0sdZmtiqBxJUKSrHKCXrFUsmBFZz5j5dYK65HAY3Rzmi8mJEjq4nsPku/KaOg0+1TQ11 evUlYax8c30WhDTs8sYRsfBT4Ogviq9dpjV727D6No6EU0u/KKLm9ht2/5iTaO0MDUCn cqkf8pDHdKq2x2zxol3Cdy/14Y1ewC/Bj9AtSyjvMNxDqgXIj3Ysy0i2P9CqqHlWlffb 13yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=N1maizpi1vmdbhxANidxCtA36sfGaIq+1RwFbQCyh+w=; b=ehAfRCpb4hb53WXbTXK1mRCPAT1ngZD/w0PObDjvu9YBGIQpjbmvOYdyhVYX+G1jc7 /tOlzGruSGPGg85dFE5NwYkBKIYWEeDjuLXFW7d7R5F/yUf6ocuv/IVpx8WrL51q4nGy m0v94JaxvmrG1Y/uDkhTbT/H7HeDRIM2idub3wbkmLQ0psEFKBF/c2cEeFahRwKVNSE+ m8jCWBin+3hf/Ft9t8QnmZMkp1bpJbVbMFWKHUjV6/LsYFFfnIfUGjojGhj9GCz6Bngv 1AZ+Fk78s6UeM7eY6UgaNgXOSGqS5k8ZCmuVC0tL//w6g/kUTcc2SbebyNKmqbzofgKa NG1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si14001472lfp.444.2021.09.14.10.21.01; Tue, 14 Sep 2021 10:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbhINRU0 (ORCPT + 99 others); Tue, 14 Sep 2021 13:20:26 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:52070 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhINRUZ (ORCPT ); Tue, 14 Sep 2021 13:20:25 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id 517711F41E7E Message-ID: <58536544-e032-1954-ce30-d131869dc95e@collabora.com> Date: Tue, 14 Sep 2021 14:18:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v3 2/6] futex2: Implement vectorized wait Content-Language: en-US To: Gabriel Krisman Bertazi Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , linux-kernel@vger.kernel.org, Steven Rostedt , Sebastian Andrzej Siewior , kernel@collabora.com, linux-api@vger.kernel.org, libc-alpha@sourceware.org, mtk.manpages@gmail.com, Davidlohr Bueso , Arnd Bergmann References: <20210913175249.81074-1-andrealmeid@collabora.com> <20210913175249.81074-3-andrealmeid@collabora.com> <875yv4ge83.fsf@collabora.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= In-Reply-To: <875yv4ge83.fsf@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gabriel, thanks for the feedback! A few clarifications: Às 22:03 de 13/09/21, Gabriel Krisman Bertazi escreveu: > André Almeida writes: > >> Add support to wait on multiple futexes. This is the interface >> implemented by this syscall: >> [...] >> >> +/* >> + * Flags to specify the bit length of the futex word for futex2 syscalls. >> + * Currently, only 32 is supported. >> + */ >> +#define FUTEX_32 2 > > Why start at 2? I was planning to do: FUTEX_8 0 FUTEX_16 1 FUTEX_32 2 FUTEX_64 3 > >> + >> +/* >> + * Max numbers of elements in a futex_waitv array >> + */ >> +#define FUTEX_WAITV_MAX 128 >> + >> +/** >> + * struct futex_waitv - A waiter for vectorized wait >> + * @val: Expected value at uaddr >> + * @uaddr: User address to wait on >> + * @flags: Flags for this waiter >> + * @__reserved: Reserved member to preserve data alignment. Should be 0. >> + */ >> +struct futex_waitv { >> + __u64 val; >> + __u64 uaddr; >> + __u32 flags; >> + __u32 __reserved; >> +}; > > why force uaddr to be __u64, even for 32-bit? uaddr could be a (void*) for > all we care, no? Also, by adding a reserved field, you are wasting 32 > bits even on 32-bit architectures. > We do that to make the structure layout compatible with both entry points, remove the need for special cast and duplicated code, as suggested by Thomas and Arnd: https://lore.kernel.org/lkml/87v94310gm.ffs@tglx/ https://lore.kernel.org/lkml/CAK8P3a0MO1qJLRkCH8KrZ3+=L66KOsMRmcbrUvYdMoKykdKoyQ@mail.gmail.com/