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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51FF6C77B75 for ; Mon, 15 May 2023 07:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234890AbjEOH04 (ORCPT ); Mon, 15 May 2023 03:26:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238702AbjEOH0z (ORCPT ); Mon, 15 May 2023 03:26:55 -0400 Received: from out-5.mta0.migadu.com (out-5.mta0.migadu.com [IPv6:2001:41d0:1004:224b::5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56028DA for ; Mon, 15 May 2023 00:26:49 -0700 (PDT) Date: Mon, 15 May 2023 03:26:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684135607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MiMXjQSln0dtBobMFdzPKQ/MVgbhIU/qdMUMXbRpyRs=; b=Yo5HQVlC5T/RlG0F1NWP61AQIcCBYkCdSZHYD/8ksY1fzx4GYr8jAZCkCoFZ9mjij8r5wY yc+vGtVq6FiqqbQ9ko1zj2ZfyajpGWAh9LjNtlTIgeBjnU9rT7JioXlndCvK44yEqWF6DI BpyHKJ5Sa1jkY/phUwXQ4KJRDbYu/wM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Eric Biggers 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: References: <20230510064849.GC1851@quark.localdomain> <20230513015752.GC3033@quark.localdomain> <20230514184325.GB9528@sol.localdomain> <20230515061346.GB15871@sol.localdomain> <20230515071343.GD15871@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230515071343.GD15871@sol.localdomain> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-bcachefs@vger.kernel.org On Mon, May 15, 2023 at 12:13:43AM -0700, Eric Biggers wrote: > 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. If you were actually wanting to help, that repository is the tool I use for kernel development and testing - it's got documentation. It builds a kernel, boots a VM and runs a test in about 15 seconds, no need for lifting that code out to userspace. > > 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, I'm not an idiot, that was one of the first things I checked. No unaligned bkey formats were generated in my tests. The latest iteration of your approach that I looked at compiled to ~250 bytes of code, vs. ~50 bytes for the dynamically generated unpack functions. I'm sure it's possible to shave a bit off with some more work, but looking at the generated code it's clear it's not going to be competitive.