Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38498492rwd; Wed, 12 Jul 2023 08:26:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlH34erlExr9CiUL9G3dxuES3Hti3LQVeNoGh9263ej10lLkgxgh5AaAus72GHyhD3IZtLsE X-Received: by 2002:a17:906:297:b0:982:c8d0:683f with SMTP id 23-20020a170906029700b00982c8d0683fmr18480922ejf.18.1689175593530; Wed, 12 Jul 2023 08:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689175593; cv=none; d=google.com; s=arc-20160816; b=XxZ7YUcMrA816MM79F6NfLmreDlPoswnRDwf+H7pnSvdK59NIuHCRldO9lFlbUodT9 iwXJ4CszzKisCZjYukKQxi4mkqitgVclv+faucI3s0rJC2fu4Wnu8ZGCAloAunjAOAyx 3MtB7sWnnwc+IC8fI1+FqOc/ooIs48H/6drlfIVm2wXL1WrSv+H7dv7NBUvAVrazrmoI B985nGSo7lwdy7SteOgRfEnAnAjZ8oASASveBu+NEAgIxVYBNC99hnLom59XUdTOTzv7 7aJ0ivllmFWinO7i5vZPE+ln25kpVu5HNrYE4jNGix1G3Utv3H1KUEooE536MbXG9JEF aBFQ== 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:dkim-signature; bh=pC0bLEcnBiwLIxu3syoVMwHeIHk1xFP1scSsLouie0I=; fh=zDHiJ0kFpW3lAEi2K3Zd8w7xUXEAhFG68V2N8ulvU8k=; b=IuCodf0ygSk/oJNcy8uwqRZStLso7D72CMTOBlFKkyRwq1MaEOITGIVX5S+0kzVnP1 ghSryfgIdSb524i6gfSYVZ/6DMkJufFefS7IBsWu65gpBc1uZvFNB2mIU4warzC85goO rUFPjRpA2LFgqzyhbGRHICf4xddwpjdLDqL60AU1JrZCYbDBkCZqECpBgRNrKUvRpunv i4YHCaoWJ2dq4Y/c2Zy/oDVvRIOz9RwlD7CApxKOZa9WYyOxhYRskd++XX6AZCe6OyVQ kYNU4/rvWCWJOyrQ6cvFz5FjVFhffzcrWRkgNnuKdtxPWOcOgQyKOVhOzQ1g4wtWd20n w/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=eS71i0an; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ov2-20020a170906fc0200b00992aa293b8csi4790327ejb.332.2023.07.12.08.26.08; Wed, 12 Jul 2023 08:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=eS71i0an; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232584AbjGLPGx (ORCPT + 99 others); Wed, 12 Jul 2023 11:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233291AbjGLPGr (ORCPT ); Wed, 12 Jul 2023 11:06:47 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 145B11FDE for ; Wed, 12 Jul 2023 08:06:37 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7748ca56133so55744739f.0 for ; Wed, 12 Jul 2023 08:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689174396; x=1691766396; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pC0bLEcnBiwLIxu3syoVMwHeIHk1xFP1scSsLouie0I=; b=eS71i0anKlE6fUCJhqBlfIR7gzxmlpePoIgjdxv7LESb/DQouUJs4o95gw8uM98szf N34KIxNSbgiF0oWIdBMmitBzsv1S8FM6QC3etmI/4HKMVbsIL81HtNKU57CBkmFxCOnd gGx4t7h7hTRBYFGlkKZYlryCRSoEKfBNLa8m3jSYnSiSxvKrRX3yXxkClzMHk0BSC15D BCpReSbIZA8ROeWiGvuK7RUZus32QHkjVWNSJhQcbn4M9oGfJUoBvR99WhIVV2SZoecW +c7ZfkIWP7D6nf7S9TkDACqPmXcHdzasrXWWJj0NOAIdMMUbud52Rl2btAgdnlvBvmjG u3xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689174396; x=1691766396; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pC0bLEcnBiwLIxu3syoVMwHeIHk1xFP1scSsLouie0I=; b=T7hrTz/7mQUhsbk8dOlDsgmaEPxLQwCeUxALgXeuhnJfSLEuiY9ro1zbbOW5KVACE2 G/EMz3gn53yb9kUIlfqDwQJde+dbz7uaX0/xrMAAYQS/s9dSyLMZ4ySZ3uQShk2Hyg43 HEFxYTByhCS0JwY9Ee9Qyqm6A15e4vQShqOcTeLWRgzLW5itXpYnU6MzYP8zHI8oFC+P byCEYnqQhKi85YIh3oDi/LRbNCukBupffdesIDtg1Y0WQ0/4zy2/KujbUZrsARr9bNoA FHDArG3fifJBfuxVIyl5bWvlZ0mpSCNUDoQYBzNVCOPBhMbnePL701hfofGHGZ3Df4m8 iZaw== X-Gm-Message-State: ABy/qLaqsgOSP1ws3yS28r0vsS5IKBldMxsD5kt/v/fFFbBjQurTD2E/ UHmW4sbENlSLeBiEd5qL+0DlSQ== X-Received: by 2002:a05:6602:474e:b0:77a:ee79:652 with SMTP id dy14-20020a056602474e00b0077aee790652mr19984055iob.1.1689174396427; Wed, 12 Jul 2023 08:06:36 -0700 (PDT) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id a9-20020a029f89000000b0042b76deb22fsm1212784jam.92.2023.07.12.08.06.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jul 2023 08:06:35 -0700 (PDT) Message-ID: Date: Wed, 12 Jul 2023 09:06:35 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 5/7] futex: make futex_parse_waitv() available as a helper Content-Language: en-US To: Peter Zijlstra Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com References: <20230712004705.316157-1-axboe@kernel.dk> <20230712004705.316157-6-axboe@kernel.dk> <20230712092514.GE3100107@hirez.programming.kicks-ass.net> From: Jens Axboe In-Reply-To: <20230712092514.GE3100107@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/23 3:25?AM, Peter Zijlstra wrote: > On Tue, Jul 11, 2023 at 06:47:03PM -0600, Jens Axboe wrote: > >> Since we now provide a way to pass in a wake handler and data, ensure we >> use __futex_queue() to avoid having futex_queue() overwrite our wait >> data. > >> diff --git a/kernel/futex/waitwake.c b/kernel/futex/waitwake.c >> index 3471af87cb7d..dfd02ca5ecfa 100644 >> --- a/kernel/futex/waitwake.c >> +++ b/kernel/futex/waitwake.c >> @@ -446,7 +446,8 @@ static int futex_wait_multiple_setup(struct futex_vector *vs, int count, int *wo >> * next futex. Queue each futex at this moment so hb can >> * be unlocked. >> */ >> - futex_queue(q, hb); >> + __futex_queue(q, hb); >> + spin_unlock(&hb->lock); >> continue; >> } > > I'm not following; I even applied all your patches up to this point, but > futex_queue() still reads: > > static inline void futex_queue(struct futex_q *q, struct futex_hash_bucket *hb) > __releases(&hb->lock) > { > __futex_queue(q, hb); > spin_unlock(&hb->lock); > } > > How would it be different and overwrite anything ?!? Good catch, this is a leftover from storing the task/wakeup data separately. But I got rid of that, so it's stale comment at this point and we can certainly use futex_queue() here again and drop this hunk. Will make that edit. -- Jens Axboe