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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C322C433E0 for ; Tue, 4 Aug 2020 02:43:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 37E202245C for ; Tue, 4 Aug 2020 02:43:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="YAE6FBIz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37E202245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8F16A8D0120; Mon, 3 Aug 2020 22:43:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87A5E8D0081; Mon, 3 Aug 2020 22:43:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71B6A8D0120; Mon, 3 Aug 2020 22:43:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 580F18D0081 for ; Mon, 3 Aug 2020 22:43:29 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A0BDE180AD804 for ; Tue, 4 Aug 2020 02:43:28 +0000 (UTC) X-FDA: 77111340096.05.shoe45_30097f326fa2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 7FE8318014D01 for ; Tue, 4 Aug 2020 02:43:28 +0000 (UTC) X-HE-Tag: shoe45_30097f326fa2 X-Filterd-Recvd-Size: 8868 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Aug 2020 02:43:27 +0000 (UTC) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200804024323epoutp026a186c83586e1b81b7ae9b0692c112a2~n8Hr5ita-2299222992epoutp02a for ; Tue, 4 Aug 2020 02:43:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200804024323epoutp026a186c83586e1b81b7ae9b0692c112a2~n8Hr5ita-2299222992epoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1596509003; bh=efUF3OauyIYy2ZeInIYQX3y3ABVq603mybX5XsvlbC8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YAE6FBIzmlF76u6mhGP2BKUSsXCAqTEjT8Lc0e5owINDVFqakB2Cua4ZapgnUxoDp exa1SzKmfYS0V3YCW0TJdT7eG+BN91le+7EesCNhoH8WenwLP5jVS+8UQgFqGBbKUO 979KmiD0d0FQ3UD8KjRmnIiwZj5vbm3MM+bCk3xo= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20200804024323epcas2p49da0b5af8c88f847159e4035e466b2bf~n8HrhLRrf2035120351epcas2p41; Tue, 4 Aug 2020 02:43:23 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.184]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4BLJw91nh4zMqYkk; Tue, 4 Aug 2020 02:43:21 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id EC.B3.19322.94BC82F5; Tue, 4 Aug 2020 11:43:21 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20200804024320epcas2p1340f90f12a938fd459d0ff695723befe~n8HolDU2Y0232102321epcas2p1c; Tue, 4 Aug 2020 02:43:20 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200804024320epsmtrp269d541f3c42a5aaae44f3879299a249b~n8Hokcpq_1325213252epsmtrp2Z; Tue, 4 Aug 2020 02:43:20 +0000 (GMT) X-AuditID: b6c32a45-d2296a8000004b7a-67-5f28cb49bd4a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id F0.28.08303.84BC82F5; Tue, 4 Aug 2020 11:43:20 +0900 (KST) Received: from KEI (unknown [12.36.155.227]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200804024320epsmtip1545a534f872b1e80e2427e6ec3d2ca2d~n8HoXkX340266102661epsmtip1N; Tue, 4 Aug 2020 02:43:20 +0000 (GMT) Date: Tue, 4 Aug 2020 11:35:48 +0900 From: Cho KyongHo To: Vlastimil Babka Cc: David Hildenbrand , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, hyesoo.yu@samsung.com, janghyuck.kim@samsung.com Subject: Re: [PATCH] mm: sort freelist by rank number Message-ID: <20200804023548.GA186735@KEI> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Brightmail-Tracker: H4sI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vas5iRX 9fnp5RyP/BZMmbRG8t/+VzH7zqaduiUWveDiIZO7LdV5j5926SaZZW5X87qVsqRlhmimEktx RqKhFnNRcSIAf8p65/MCAAA= X-CMS-MailID: 20200804024320epcas2p1340f90f12a938fd459d0ff695723befe X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----WRrpVrAvuAaPq4m-B-8XpfgGTgMokB6fpxFiZcPqPZec0A9D=_73fc3_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200803061805epcas2p20faeeff0b31b23d1bc4464972285b561 References: <1596435031-41837-1-git-send-email-pullip.cho@samsung.com> <5f41af0f-4593-3441-12f4-5b0f7e6999ac@redhat.com> X-Rspamd-Queue-Id: 7FE8318014D01 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: ------WRrpVrAvuAaPq4m-B-8XpfgGTgMokB6fpxFiZcPqPZec0A9D=_73fc3_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Aug 03, 2020 at 05:45:55PM +0200, Vlastimil Babka wrote: > On 8/3/20 9:57 AM, David Hildenbrand wrote: > > On 03.08.20 08:10, pullip.cho@samsung.com wrote: > >> From: Cho KyongHo > >> > >> LPDDR5 introduces rank switch delay. If three successive DRAM accesses > >> happens and the first and the second ones access one rank and the last > >> access happens on the other rank, the latency of the last access will > >> be longer than the second one. > >> To address this panelty, we can sort the freelist so that a specific > >> rank is allocated prior to another rank. We expect the page allocator > >> can allocate the pages from the same rank successively with this > >> change. It will hopefully improves the proportion of the consecutive > >> memory accesses to the same rank. > > > > This certainly needs performance numbers to justify ... and I am sorry, > > "hopefully improves" is not a valid justification :) > > > > I can imagine that this works well initially, when there hasn't been a > > lot of memory fragmentation going on. But quickly after your system is > > under stress, I doubt this will be very useful. Proof me wrong. ;) > > Agreed. The implementation of __preferred_rank() seems to be very simple and > optimistic. DRAM rank is selected by CS bits from DRAM controllers. In the most systems CS bits are alloated to specific bit fields in BUS address. For example, If CS bit is allocated to bit[16] in bus (physical) address in two rank system, all 16KiB with bit[16] = 1 are in the rank 1 and the others are in the rank 0. This patch is not beneficial to other system than the mobile devices with LPDDR5. That is why the default behavior of this patch is noop. > I think these systems could perhaps better behave as NUMA with (interleaved) > nodes for each rank, then you immediately have all the mempolicies support etc > to achieve what you need? Of course there's some cost as well, but not the costs > of adding hacks to page allocator core? Thank you for the proposal. NUMA will be helpful to allocate pages from a specific rank programmatically. I should consider NUMA if rank affinity should be also required. However, page allocation overhead by this policy (page migration and reclamation ect.) will give the users worse responsiveness. The intend of this patch is to reduce rank switch delay optimistically without hurting page allocation speed. ------WRrpVrAvuAaPq4m-B-8XpfgGTgMokB6fpxFiZcPqPZec0A9D=_73fc3_ Content-Type: text/plain; charset="utf-8" ------WRrpVrAvuAaPq4m-B-8XpfgGTgMokB6fpxFiZcPqPZec0A9D=_73fc3_--