From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796102322; b=5NAz8DiB+FHBu5rb7ViazMIDCzALp66Ig5XEqMw5bxlqbglpCE69+0rnZGc9hALpj46S hSvJnW/J6ofAQclL55ZboFMrvVZsdozXq0fyY8N0gSxyhyD+KjfxyrHldOKLH3qKhk4S3 tKwuwSLE8FYQEv59jBkDCq9ad8fu5t8ujrtkacigo+SPsGxeiPTymFWHZ1SRXcs+w9ijq 86/yekIVGUAI+WRpHjPcM0Iz+fWkUXbONPuueMhHxSll27/GTj2z4BCN/rARFtKG49yhl zPcHfxjklJ72dcjG+6cJHdwlnPgZjQDylPg7MRgJRIIVxoPJHJOIpN7cznwvGHAXTPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796102322; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=noDYXLw4/OgRuta8mOLD8kSfTzVzfQXs4Wb0Utma8s4=; b=QOetd21RGWzIGYNbELIrtiZsaBgvll8g6OGp97FUTBJqj9eCtFuHB8SPN94Ne5ihQJap GcMDRUgEQJfcr9Z7OOhVDzKgT5GiBYTYn/qGp3TF0tGDEjjxDvL9juUoGp30dlwlRhCLU r26QmF/t5UnLcTODBMEkGRb7aQ1v+3eFm1IfvCBUKq3u8Ivt+jOAKukFBJegU5YZ6tyj8 SdGaT1fCJswXuBJPFvi2XGwzcDfvVytgyTMGYri/iJukZwyPIsLMwhyvftkTsUKQeKi3A mDyL/eU1crlU6XZhhpc7Q0WB30APzxprblDltAxCHet/u74iYbW/HqYKrpZ5IrYUSnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=feBVNjPE; arc=none smtp.remote-ip=209.85.215.171 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B871606A320 for ; Tue, 1 Dec 2026 05:18:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B871606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=feBVNjPE Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-cde84cb8803so3297589a12.1 for ; Mon, 30 Nov 2026 21:18:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1796102322; x=1796707122; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=noDYXLw4/OgRuta8mOLD8kSfTzVzfQXs4Wb0Utma8s4=; b=feBVNjPEqRyDNkjbMUHJCKHbgq2HErkuW2f+K18D8RkY7lXL1iQypQjwB1RUkUwcnS ZQT13Pn/tZuaZyu0G9oak2/jR9Tk1nV/K7f9DlC14VoLh/wifrVTdQr7azZqYU451n9d 5UABW4vHYWq2siM2Y0pNJ4CbKL9D1dRrT60u0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796102322; x=1796707122; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=noDYXLw4/OgRuta8mOLD8kSfTzVzfQXs4Wb0Utma8s4=; b=rqlHsk5rU/5xYIwDFjA0gXnwOJYIMB3IzD/DI6CFP4FxNmQu0zTnymBgIeLeUyGKw9 qCrBVLrYVehJD4vm9GbmBWOdr3sQhsKvyC3tmP0rl8ugVKltxXll9OjpSsBBaiAOMrlS luQmZawVwl54I8jLPA3CJXFpu8uBVJ6cCphTecpePNVRKpaYzbGY6fMK2fUNtKfHqBei g4B86M36lSrt+PhZ7TkoEIQzER2Xi6WidG5m31mcqvgOdtWePapE7E8Hifdlmo7afHsw DpFpPlbqWkjkL4HaJCoRqQjM3dc7qQXMccLwetOg76hCuF9Jva407H4Mo1/NF4fmVyF8 mSIA== X-Forwarded-Encrypted: i=1; AL+hErGL+igDze2fkJgr7V33VEYy63/NqQ/suu+dYEUlkK2YjHADhkBQ5gtGu95rzbmDn6ww9oKHH8951xFEUR8=@vger.kernel.org X-Gm-Message-State: APuU4Z/2MdFxTd0+UfpukhAt/4BfFDXXOEKbW13GFmdj/+YUzxmMMu70 O7cFgAt6WnK7aWsAkEltNgTk5UTYvUC+ycZo9VHuwyrwx/VBrmgY6AC3lGAisqxxag== X-Gm-Gg: AZFdTZfJ41kiHsCophosvhUPuIoV1s+AdgkxlpD2rTiVmf3xxfmetY7KIJj/YS25EfT vUaiGZf1U1JbWS3st7vSjszfPIQ0FueZobXNh6LvKIErEPgp5pmd26P85TPft6/zxZXvHsloUov 8q3mS7AWsqKbiVTsNTMmdjRp5tYvj4VWQgQjsrqPfcjPF7gAahH7VJaskSCWT6ZbRZoeVnuwpR3 sq7DIAi8ASGLRXVMH/ydeoj4Fmwttq0E06YIXzNbqutfPw3F33IPbaKZ9nK/h0ac5rC4kjUTiZJ nLCiFmLW/UI8oNqB3LrLPxDtcZsEAc2fGI/dtVURAIbb2wZkvg/RRlDMdYs0akqSKt0MKi4BE63 pks3XArTy1y8PztuINVLO4GIkCKOd6xaloyps4UzkJenXOoQGVlb5A2lPBWtbNHlXVU0X3eaoFN wwjZD74mJdrZUxlNrvdIc5P2OnYGwh1tUfKJV3yr8gPdLL3UrcyOOmqkEM8MJ7WVI19rQTttJpE dbJA3PoxSwW2/xwyTjtUKFBQ9fkTWGoGsC7n38FgqWRETe3JklTbsprYx2RrAaizZ6wOZ/AKUeu xV3v+hA8fK5xAdH7aX3YTuJ8S7H7zyrcvUSdiG4+ldmvKrvWnj+VCU2FHLAnOOsS9n2Z X-Received: by 2002:a05:6a20:4308:b0:3eb:b2ce:7b4f with SMTP id adf61e73a8af0-4014c34fdfemr42030192637.68.1796102321831; Mon, 30 Nov 2026 21:18:41 -0800 (PST) Received: from google.com ([2a00:79e0:2031:6:b627:1570:b7a8:70e6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cea770asm19642117a12.3.2026.11.30.21.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 21:18:41 -0800 (PST) Date: Tue, 1 Dec 2026 14:18:37 +0900 From: Sergey Senozhatsky To: Jenhao Chen Cc: Sergey Senozhatsky , Minchan Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, minchan@google.com, liumartin@google.com, benwei@google.com Subject: Re: [PATCH] mm/zsmalloc: inline obj_malloc() and obj_free() Message-ID: References: <20261030121700.260975-1-jenhaochen@google.com> <20261105103947.7521-1-jenhaochen@google.com> <20261106011233.3270937-1-jenhaochen@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261106011233.3270937-1-jenhaochen@google.com> On (26/11/06 01:12), Jenhao Chen wrote: > On (26/11/05 20:09), Sergey Senozhatsky wrote: > > > If we also mark obj_write() __always_inline alongside obj_malloc() > > > and obj_free() (with noinline on alloc_zspage()), the compiler CSEs > > > those redundant operations across the fast path: > > > - arm64 (Clang 22): -31.3 (-O2, -4.0%) / -34.7 (-O2 + AUTOFDO, -4.5%) > > > retired instructions per zs_store() + zs_free() pair (vs. -8.4 for > > > obj_malloc() alone), shrinking zs_store() under AUTOFDO from > > > 3,144 B to 2,448 B (-22%). > > > - x86_64 (Clang 22): -26.6 (-O2) / -31.8 (-O2 + AUTOFDO) retired > > > instructions per pair (~4.0-4.5% latency reduction). > > > - x86_64 (GCC 15 -O2): -37.1 retired instructions (-5.1%) and -5.3% > > > latency (-5.5% cycles) per pair, while keeping zs_store() slightly > > > smaller (1,997 B -> 1,943 B). > > > > Great, I'd love to see that in v2 commit message. > > > > > Would you prefer that I send v2 rebased on top of [1] (including > > > __always_inline on obj_write()), or send v2 against current mm-new > > > first? > > > > If it doesn't trouble you too much, can we finalize [1] first so then > > you can send your patch atop of it? I can ping you when [1] is done. > > Sounds good to me -- no trouble at all. Let's finalize [1] first, and > I'll send v2 on top of it (with __always_inline on obj_write() and the > benchmark numbers in the commit message) once [1] is ready. Thanks for > offering to ping! So I think we stabilized all the zsmalloc patches, should be in linux-next by now.