From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.169 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796102322; b=YYcCDyGi1qWPrMO6Df82XUJfpBcLGtGFbWaMZR5xQwfJntqjJv54aQKThMl5pWB/J0ki y6exBFiJKLcJo/EM4Jtgtki/mt4C3yhfx/ATEZ3wWtN1JCDWCk8ydVePbd64alqsTD8CH W8/3wH2VGKEmX2ZqDh9BP1Q6DDa3h8vxAnt0RLEDAfS6Ve61yUce9RJHoP9M5hr6cXxY0 iH/PkDtXNP0xFJSR2Ycnq6C9PRuxwHyeGSPnOkCqbhtTUuRDlVHytYCPH+oLx9eyHbYEc grBTzi/BspmkuOmE97E0D38eN1aGl9rA2mTz8IF1RkvL83NZGk2p7JgGnNOEvmSBj2w== 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=bSkRxj/PZravEp/on1mjqmtz3dmePBOzy3qCrkesS7waJ06fQzus8iHJuWneE8FvHRiC 5Q/gK11oCAKWKtJeSJP9EfcTt3kppXpIV9EnlZXgi4anIK/MD8Li25esKhvp19uBuuh6E U22PlX2hKn76GCm8U2inycW4FruPxlkvZUUqrih9WOmoJ9rpw4xT5901zIM8qwya/L7gF pFrx1eFAd3rCBQ/lBZhxPuNdUBIHPEnZqrN8R9Dl7YDg5NWLNMgXgiWU+qyZIr1JZg0fG ZV0e5nRwb7jDzBHgi4vfvUixxwt9fpC4CD6g+4ROwXCbmOJYLhZRxsdC8n159YE4h0Q== 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=bbtnO0nv; arc=none smtp.remote-ip=209.85.210.169 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 69311606A31A for ; Tue, 1 Dec 2026 05:18:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 69311606A31A 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=bbtnO0nv Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-8d1aec63541so1871334b3a.3 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=lists.linux.dev; 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=bbtnO0nvEDJ9gwLCFAunu2YlHE336jVgCFsSEVnRYLTZhzcCaw/HDe7klulDW3Ov5J 0Z76xIjpLtvIkVDFWmYRlxzCFOcicIzOkul2TGQUrxVyRrewYXEsyxw936EuxwEfcbVt rDugGUtRwvveYNe46rTufFvsZ1LjlJzWGP8E0= 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=MEtYoQsUOvlt38igw5gpByA9bzFxUlOk3jB/2S7FdkoZRo+IgsxN1PVnfvb4V2yg4S SQb5LZzds/PeiE23zUTrNe552cqDCsYC42KONwGo0FVLYjIh48OTD9ZkSJ1CYYF55aG+ NKSGWPLA7VTKgGVoiSyj0wTwXo7DDsKc4L/yO+zrer8xzx2eesWlS/7+CJqsSaOvB4xg jaONfmAtRx08v/PW9DQbE9K9tv2RnS4M8euiRxV4nSeeKn5WFCUQeBzrt8Fj2NcLGxaC B2BzkK/1XvwBjI6AQz+hLBHt6SzO8CIWu0nyCvIbiKO1nIcUbzECYSyJ5VcDr+O6XAEN LjGA== X-Forwarded-Encrypted: i=1; AL+hErHwFxKgRB2gOsmPb6rdLa1NVqcG+ICuDO8gwLyAQzBifnKyZSyxL6gSLV++DnyQhN7rPcAq@lists.linux.dev X-Gm-Message-State: APuU4Z9HXQ8Qbsxod5jPbwIb6iH4WgKdMPWvYHepprkb/YihxyNtg8Sc v+gswR7kLbpq4nNJlV6Rg3A+Yf5s/j0k0XY5NYnKxl8kJefS3Mwh2NT4OVYEpMoHCQ== X-Gm-Gg: AZFdTZf+LzhMEL+avghGs7ETOsTl2BWRBGnBthpDSnjcDGZLrRRyl9eU1icueaDIJYy vlHrHrsDbLfsnGFd829BG1ftPU13F4d8QSJAxWXMgEuSRJYGaitotBVCxQiokbWQsf8GyAW3oK4 5KHJagkZk/AXFFbI6rM/dDHcHhDnqMzB8yeFd1i9fPtV+xcnx+VyPYFNFGmy1q/Cu8Ppic472dy 93rsOpQHKDwpM7MkCbWIKW/acTKtwC3s0WiHAcL8CQ1VHnG19cPjOTiLq6tB3OMalm10fkOUOvV 1k0enPkNaezGomWEkYM84f4dMcN2AmjjGtmgRiD/mXt4DQ4HrW8sJHTfp/Qa6nT7uk5fQdb3tx5 PMI+T1gAoK0f8gAMREv+xxgCCU5ppbtqUL1N7rzdk4I8w2171catY344//OqidPyyod/BK6uAFE nE1bohod9gyydw/Bud/aXAlRfdHh2TPTZmzIrDpWKCLLlVPp/YwceFA3bKlYjXEQ+XfmGjpP/Bp YD2H2lNBLgj+7qTzyZcSKK6nc46ft1t6A6JvkOwfUIzlsY0+yx++IfMOfC3rWaFbL+LbwlrjWxk UDMDBjO/1AtUCF6N1Z60o+CnE5OkpCN11iHeWDjxZWGiZrJdye3rU9+y6SSbIkbl1Ii/ 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: llvm@lists.linux.dev 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.