From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D589CC77B75 for ; Mon, 15 May 2023 07:13:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50BBE900004; Mon, 15 May 2023 03:13:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BAE5900002; Mon, 15 May 2023 03:13:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AB4F900004; Mon, 15 May 2023 03:13:50 -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 2A3B8900002 for ; Mon, 15 May 2023 03:13:50 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 01D8D812E9 for ; Mon, 15 May 2023 07:13:49 +0000 (UTC) X-FDA: 80791624620.28.F862061 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 5A5CD180002 for ; Mon, 15 May 2023 07:13:47 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="cb1/nGDI"; spf=pass (imf06.hostedemail.com: domain of ebiggers@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684134827; 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:in-reply-to:references:references:dkim-signature; bh=EgvWtKrsSgH36u/g3MwJgM3xHSfuEEuf1LBdkMCMhJQ=; b=3jpdJSFcIAeAGlRbmODHadAFFoCgL8oGv3Fl4K7yjGgaf+GsbyeLmHOscbsGfwahke87x+ wNmRvriWMxaXIVY8JOGl4llfuog1q2bLSykVA7qf1qGgWioNLNlXasVQVRIWWXw2UKPdZv QF6nZA5wgmMQstziktZhIwMKMiN1vXk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684134827; a=rsa-sha256; cv=none; b=4SOc1BQV+2YBj+BoXe+mWppMAm/B0z5wI7Kzmpc8yoUzFK2B/9S5XRsgv+NxWPN0nH9zWO gInuxJyRAjEIs1gS1my4cCB3Fu7sltKUprsdH6F7PFAspHRYM5lE7wp7rJaSJNtE5Kni7J hhz9DwQN1c7X3Dhjcs2pwBAqgUjqLCo= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="cb1/nGDI"; spf=pass (imf06.hostedemail.com: domain of ebiggers@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E455560EBB; Mon, 15 May 2023 07:13:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 156D9C433D2; Mon, 15 May 2023 07:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684134825; bh=Blp9UTVwqWg3TA5Q/aNLyv7una68PusuriG4Cx6TJ1I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cb1/nGDInJgxvoRAiPafNqmATmMoBlsuo3AOYZmbnMEWUu9D+/GzhbjwxdSL7KZgC poCnKGNOC6I2NebFqG89wbQBuyFdlzYsHlmL0tIzbvDH/YvmHuXrgODI1SREFX9L4s r7F8kHdWUCYiDtn8Nyxv3siipSh9+93pil61u1IpNHXbL8/N5Gb1dpQ/qb1Q17f1Jg djZaDbecgKuQZqXSVhkqwtOU+4e75+6S1PLqVYW3fQJXh2V7wo33rBp4rungohG/fO 5SByQ8uiE1Y2wRDoEYxnSuhpjAwRnM9zuRuGbWbXRIG/uXpG2+FRauo0FtweydTfxZ 59Mbo2AG7dWbA== Date: Mon, 15 May 2023 00:13:43 -0700 From: Eric Biggers To: Kent Overstreet Cc: Lorenzo Stoakes , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Kent Overstreet , Andrew Morton , Uladzislau Rezki , linux-mm@kvack.org Subject: Re: [PATCH 07/32] mm: Bring back vmalloc_exec Message-ID: <20230515071343.GD15871@sol.localdomain> References: <20230510064849.GC1851@quark.localdomain> <20230513015752.GC3033@quark.localdomain> <20230514184325.GB9528@sol.localdomain> <20230515061346.GB15871@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: chzmam6jnpjxqb8fktjtaycyjyteohcu X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5A5CD180002 X-Rspam-User: X-HE-Tag: 1684134827-566550 X-HE-Meta: U2FsdGVkX18kjQFYR+QseDDhEND29XIoU++ghbnYVJzS/BCL747fPLMEuVX4qDD0ObfBCApFp4Km2xzD8HvDfBzJatbIftHGn39wrrrklHs9vy0Ik3pTieFb/JoVNtkBXhXfyanu8fftn4cP7hnlCeXy851tw/XzqSrxo7wnCYmepPSQnI7RUHbdhihIr+Ws1oPtmeUq3bX+yiit0iJAFWY3nnWY07f/GxiQz1T5a/7whvDmirqaDGDLINAFcMS5vLJ10+6eSVvG5ovEyM6ct2dR6fj/NVCVWRjU42qvNRc2V5lgZDGPPNupgl9RQwwT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GBXXw9raWKi1nVLpepyvJAfVDQs8ZzLkxRhoZGe9s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 15, 2023 at 02:18:14AM -0400, Kent Overstreet wrote: > On Sun, May 14, 2023 at 11:13:46PM -0700, Eric Biggers wrote: > > On Mon, May 15, 2023 at 01:38:51AM -0400, Kent Overstreet wrote: > > > On Sun, May 14, 2023 at 11:43:25AM -0700, Eric Biggers wrote: > > > > I think it would also help if the generated assembly had the handling of the > > > > fields interleaved. To achieve that, it might be necessary to interleave the C > > > > code. > > > > > > No, that has negligable effect on performance - as expected, for an out > > > of order processor. < 1% improvement. > > > > > > It doesn't look like this approach is going to work here. Sadly. > > > > I'd be glad to take a look at the code you actually tried. It would be helpful > > if you actually provided it, instead of just this "I tried it, I'm giving up > > now" sort of thing. > > https://evilpiepirate.org/git/bcachefs.git/log/?h=bkey_unpack > > > I was also hoping you'd take the time to split this out into a userspace > > micro-benchmark program that we could quickly try different approaches on. > > I don't need to, because I already have this: > https://evilpiepirate.org/git/ktest.git/tree/tests/bcachefs/perf.ktest Sure, given that this is an optimization problem with a very small scope (decoding 6 fields from a bitstream), I was hoping for something easier and faster to iterate on than setting up a full kernel + bcachefs test environment and reverse engineering 500 lines of shell script. But sure, I can look into that when I have a chance. > Your approach wasn't any faster than the existing C version. Well, it's your implementation of what you thought was "my approach". It doesn't quite match what I had suggested. As I mentioned in my last email, it's also unclear that your new code is ever actually executed, since you made it conditional on all fields being byte-aligned... - Eric