Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2153960pxa; Mon, 3 Aug 2020 08:46:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTNSSC8uEp2j8vcZq9y9YsBzZWuTK+zGMLgJF9W3lKlhV6ikPf1Xh11YtjSO62xfW4mvwh X-Received: by 2002:a50:9316:: with SMTP id m22mr14452844eda.178.1596469591568; Mon, 03 Aug 2020 08:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596469591; cv=none; d=google.com; s=arc-20160816; b=ghQrCdMNdscbiw4Uemmj773N1r7bK+hqWvcd3kDvsNOyd9bWfe4idyEBIfkApFdcxL NAJFgeUVdHuDv3F509w+pxN+T7eAOucM9U7zIEWRsS+2I5cdE2FVhPmWn7r1+tMNgQJ7 kv+KL7pDo/nYaDykI5jdVO/JHkqmBtXKTerKwTfD+CTvqLgqs+0ywNjqGa4y5ug6W2li z+T5iJPgdEpUbG/XT6qDtdfc8mbfFlpmkRfSulQWG3HkgtxJ9YZvBEW+5SITK0PM37R3 GS3jDbwoBGr47JS/bdhp2X/hFLr7tfPUlzRLYLGrIPG6pgo1hKPKdPqUHjxjPuVmLUFY 8oLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=QpHhVlCJ/slSDTrZBe93rP8X34pin1/Pme9Exd9TyA8=; b=oswvPat0RWXgGBCzjNt8Ic9eFIDQypcVtdQCN7QsfCasEZng3vGDXKbxPFsZ/XcWlg FBvTK9VD6QRBh13HLw4HwPUABaPQHXn6SWz+sXH39s+DxeUStTaH1D2llcNf7r/LvNsQ DE/6xdBuSxyyMJVx0zZ2GaqP8hM/f5960YrP3fXctAP7qxveENBVbWnYljKUgqJ2WuCm +C2Mrrj1VhGkM/NV1KWx7tlx0UB/DSFahDMdrzrYMpCisKRKrbRtgSW9bBMLjM1ciktY eK3wPE+wH0DUi8aRrUguG1AcWGx6Z1Z4yp4WItLZUiine0Ps+X1yzCX2T+I6oheuvAlE EIcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si5211399eds.484.2020.08.03.08.46.09; Mon, 03 Aug 2020 08:46:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726934AbgHCPp5 (ORCPT + 99 others); Mon, 3 Aug 2020 11:45:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:39826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgHCPp5 (ORCPT ); Mon, 3 Aug 2020 11:45:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ADAECAB89; Mon, 3 Aug 2020 15:46:11 +0000 (UTC) Subject: Re: [PATCH] mm: sort freelist by rank number To: David Hildenbrand , pullip.cho@samsung.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hyesoo.yu@samsung.com, janghyuck.kim@samsung.com References: <1596435031-41837-1-git-send-email-pullip.cho@samsung.com> <5f41af0f-4593-3441-12f4-5b0f7e6999ac@redhat.com> From: Vlastimil Babka Message-ID: Date: Mon, 3 Aug 2020 17:45:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <5f41af0f-4593-3441-12f4-5b0f7e6999ac@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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?