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 E8BCDC27C53 for ; Wed, 19 Jun 2024 07:21:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AADE6B02CC; Wed, 19 Jun 2024 03:21:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 734B86B02CE; Wed, 19 Jun 2024 03:21:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D45D6B02CF; Wed, 19 Jun 2024 03:21:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3EE106B02CC for ; Wed, 19 Jun 2024 03:21:45 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AC5E0160EA2 for ; Wed, 19 Jun 2024 07:21:44 +0000 (UTC) X-FDA: 82246793328.14.A20BE2D Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by imf07.hostedemail.com (Postfix) with ESMTP id D170240007 for ; Wed, 19 Jun 2024 07:21:41 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=RrQMEEY+; spf=pass (imf07.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.8 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718781699; 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=N3c8y99082LZUiyIK7cYq9F3f2OLWyyyWDaQP/XE8wo=; b=shMbljwLTYOFgNxMARkMg39PvcX4ClC3D5j0wM8IQJi8GaZTbd7u1xlXt8PzzB/7loq7pr 01bfzd+tvDIRJgNvRPIwwIWSDwCFhCnilpALFJ1eY+TFqehxvyZR3JaFdVXBFVOz6dPBV2 icaTbDlLzB8sAKgpe69/8cNqd4q3QPo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=RrQMEEY+; spf=pass (imf07.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.8 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718781699; a=rsa-sha256; cv=none; b=C7uRhKmeUsNnurohuutGLqiOHG85j6uZSbEJxf5xfKi11KTsMIIbQ3yKJ6wBkTL4LArQaA ncYoHYnxYOledsvE+9bsMC2o0CGstXWILQdnW/srbc8HpOS2pw9T6MxqBWPUtdJRH/4DS1 qJ0gboCzvjTILIFhLA+8s484qhMQAfY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718781702; x=1750317702; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=5NX5iiU81yy2F1qdPkNYoivs4g/8uNde2WeXBaAV8gs=; b=RrQMEEY+MH0krQakb6/lo/g5KCMZEvILz7bWJmrE3Qv3Qtiv5u3Pc/l3 PkqRSswkn0jISmFo/msFlTAbGokDs0SSFl3GsXAEEqeJw6LaFQvCu9zfy pT9/WrzK/y3bT/Pp9oFMBHa1XRfh1BQufr8BXiPn9akWUvG+ejkjPAB5b Zt4ow/Lq9izKnBvcTDYnDqv6+W5hmR+gv+YXi5/uAbhbD4j76ny5IXIig Xyqz9qJ4vgNSWtLMuMjVhPtDEKxVzlwB8vIF6ZflT5JX6LfM/0w4c6xJw zbmilrqa1U7JTog23VGpW6xnBiGrt0C7U6zWpSnbYhaddn2/E49Dc7TGn g==; X-CSE-ConnectionGUID: WADmjrA2QK+maAM3BbaIPg== X-CSE-MsgGUID: B66ttzcoTBi/+thc85SxEw== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="33246284" X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="33246284" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2024 00:21:40 -0700 X-CSE-ConnectionGUID: WeLi016KS06Ap6ULkPjc7g== X-CSE-MsgGUID: 9dpHGKYFQ5OhO5xixyqfBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="41965015" Received: from unknown (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2024 00:21:38 -0700 From: "Huang, Ying" To: Ryan Roberts , Andrew Morton Cc: Chris Li , Kairui Song , Kalesh Singh , Barry Song , "Hugh Dickins" , David Hildenbrand , , Subject: Re: [RFC PATCH v1 0/5] Alternative mTHP swap allocator improvements In-Reply-To: <20240618232648.4090299-1-ryan.roberts@arm.com> (Ryan Roberts's message of "Wed, 19 Jun 2024 00:26:40 +0100") References: <20240618232648.4090299-1-ryan.roberts@arm.com> Date: Wed, 19 Jun 2024 15:19:46 +0800 Message-ID: <87tthp4cx9.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D170240007 X-Stat-Signature: oxz7bgmr7jg6bukgxctt33mt51tq7go9 X-HE-Tag: 1718781701-933154 X-HE-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B+eustnmCaoLUpwHE93Kr9KRFBMEtM5Pkl4Upe4LBDNktnWfW8VIaWq8LhE4ibtMdCx2zsNliV459HAD+WYT0i3x8BiNL1jBGYoQFdHun9IOYl+pGrTwY= 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: List-Subscribe: List-Unsubscribe: Hi, Ryan, Ryan Roberts writes: > Hi All, > > Chris has been doing great work at [1] to clean up my mess in the mTHP swap > entry allocator. I don't think the original behavior is something like mess. It's just the first step in the correct direction. It's straightforward and obviously correctly. Then, we can optimize it step by step with data to justify the increased complexity. > But Barry posted a test program and results at [2] showing that > even with Chris's changes, there are still some fallbacks (around 5% - 25% in > some cases). I was interested in why that might be and ended up putting this PoC > patch set together to try to get a better understanding. This series ends up > achieving 0% fallback, even with small folios ("-s") enabled. I haven't done > much testing beyond that (yet) but thought it was worth posting on the strength > of that result alone. > > At a high level this works in a similar way to Chris's series; it marks a > cluster as being for a particular order and if a new cluster cannot be allocated > then it scans through the existing non-full clusters. But it does it by scanning > through the clusters rather than assembling them into a list. Cluster flags are > used to mark clusters that have been scanned and are known not to have enough > contiguous space, so the efficiency should be similar in practice. > > Because its not based around a linked list, there is less churn and I'm > wondering if this is perhaps easier to review and potentially even get into > v6.10-rcX to fix up what's already there, rather than having to wait until v6.11 > for Chris's series? I know Chris has a larger roadmap of improvements, so at > best I see this as a tactical fix that will ultimately be superseeded by Chris's > work. I don't think we need any mTHP swap entry allocation optimization to go into v6.10-rcX. There's no functionality or performance regression. Per my understanding, we merge optimization when it's ready. Hi, Andrew, Please correct me if you don't agree. [snip] -- Best Regards, Huang, Ying