Message ID | 20230922205450.033535181@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47195CE7A81 for <linux-mm@archiver.kernel.org>; Fri, 22 Sep 2023 20:59:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2CEAB6B02F1; Fri, 22 Sep 2023 16:59:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27E5C6B02DE; Fri, 22 Sep 2023 16:59:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 129C96B02F1; Fri, 22 Sep 2023 16:59:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EBF1B6B02F1 for <linux-mm@kvack.org>; Fri, 22 Sep 2023 16:59:25 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BFA551411A3 for <linux-mm@kvack.org>; Fri, 22 Sep 2023 20:59:25 +0000 (UTC) X-FDA: 81265449090.29.7E94E2D Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf27.hostedemail.com (Postfix) with ESMTP id 2788B40023 for <linux-mm@kvack.org>; Fri, 22 Sep 2023 20:59:21 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=hktQlK3I; spf=none (imf27.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695416364; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:references:dkim-signature; bh=zWIQ6Yi556U65myk2PzRkq/DHdsIiBTxeyqBKDx6r2g=; b=WEYlx7WJy1Lgv4srwwGnkdIUVl5OyYbxaInihXWd2hLwq7Fbuf0PzGzhQ+fLD8MtZE6rKe OwIJNMjOJOIBxs7QEVCzh1+yJqSTLr/pfntmMq1S2eTXSIx/IJqPdS7Ism6r/YQqOXc0gZ uj2asdcJV/ld/3eb0D78ZGiIyhyeOiM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695416364; a=rsa-sha256; cv=none; b=yFWQciN4a5/cNJOmCYH8ZsiRM/GbANLQWKVKjlWG/IAS2mUAe57iJOfEoqPaQ8H6j3vNnR W9xZopDE1dwEYyb5QjwR1NXPNNjy43j05BW0lIATZ3KTirALTPrqgexd/rfbhdkVx2B0vr 3mP+J1Ess+QZgLlxWYlwVo6FfaLPrZs= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=hktQlK3I; spf=none (imf27.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=zWIQ6Yi556U65myk2PzRkq/DHdsIiBTxeyqBKDx6r2g=; b=hktQlK3IZ5z27ejm1FLGbbL1mo mzMcjkhwk3cOL9uWlaupMqvTCXnVZAoT6CJRQ0M29Q5yLP4ldsnxOmGjX4q6rjSEI64QiOYmhDBl1 P34q0qimycD9b/kQhEEKct+8KTKDGbkWMwSTmS278soTtIfi9R+SqnOIrE5sNsyZz3ma+fTYPc4zF 1bnVko5qUEoPXj7iOJw+xXKE+NPyQD41xo32nxvuoljsm3NlHTZLfVHISoB7SITHfEz+0mYyjkOq8 DkRxp0jw7F5ICVHtOBTQtELeVEyWis3tl7y1KZ2CkP3ihqlF98Q0ECbL3/aloKy0AEDNlzdBY/hIg FSIpHA6A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qjnEs-00GXzC-2v; Fri, 22 Sep 2023 20:59:05 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id F0DDE3008D6; Fri, 22 Sep 2023 22:59:03 +0200 (CEST) Message-Id: <20230922205450.033535181@infradead.org> User-Agent: quilt/0.65 Date: Fri, 22 Sep 2023 22:01:23 +0200 From: Peter Zijlstra <peterz@infradead.org> To: tglx@linutronix.de, axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com, Andrew Morton <akpm@linux-foundation.org>, urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, Arnd Bergmann <arnd@arndb.de>, linux-api@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, malteskarupke@web.de, steve.shaw@intel.com, marko.makela@mariadb.com, andrei.artemev@intel.com Subject: [PATCH 17/15] [HACK] futex: Force futex hash collision References: <20230921104505.717750284@noisy.programming.kicks-ass.net> <20230921104505.717750284@noisy.programming.kicks-ass.net> <20230922200120.011184118@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Rspamd-Queue-Id: 2788B40023 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ojmxktkwsqsmokc5mwmypee6gw5fifce X-HE-Tag: 1695416361-122592 X-HE-Meta: U2FsdGVkX189V4QAJ+BH+Mw5DVhw5wAS3FjGGQdiaRU+y8pw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tE7IA597o+T4UjbNAJP8ZunuMXcPECjLxnDEk0hvrptMtFsyGo6chfNAsAZC8+KYWfwMI1/isVVHrFBc6tM38e+U6qzaRCseJMqRUA6s5tI0mzMcQCCrPo2gUiZO0MNKdMBRxX7t8ydDOviqg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
futex: More futex2 bits
|
expand
|
--- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -128,6 +128,9 @@ static int futex_put_value(u32 val, u32 } } +#include <linux/sched/cputime.h> +#include "../sched/sched.h" + /** * futex_hash - Return the hash bucket in the global hash * @key: Pointer to the futex key for which the hash is calculated @@ -159,6 +162,9 @@ struct futex_hash_bucket *futex_hash(uni } } + if (sched_feat(FUTEX_SQUASH)) + hash = 0; + return &futex_queues[node][hash & (futex_hashsize - 1)]; } --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -89,3 +89,5 @@ SCHED_FEAT(UTIL_EST_FASTUP, true) SCHED_FEAT(LATENCY_WARN, false) SCHED_FEAT(HZ_BW, true) + +SCHED_FEAT(FUTEX_SQUASH, false)
If you hate performance -- use this. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- kernel/futex/core.c | 6 ++++++ kernel/sched/features.h | 2 ++ 2 files changed, 8 insertions(+)