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 806A7C00140 for ; Tue, 2 Aug 2022 20:23:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1CEA8E0002; Tue, 2 Aug 2022 16:23:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECC888E0001; Tue, 2 Aug 2022 16:23:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D947B8E0002; Tue, 2 Aug 2022 16:23:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CBAC28E0001 for ; Tue, 2 Aug 2022 16:23:54 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9A04BAB3C5 for ; Tue, 2 Aug 2022 20:23:54 +0000 (UTC) X-FDA: 79755778788.01.44D30D1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 05C4518004A for ; Tue, 2 Aug 2022 20:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659471833; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hHWhRmPR1pZp1I/u9ioQ+8YdKH4+dcWOy4DQBKc/PhU=; b=DBuGvOYDkorLyR4nMMFN0QoEZ1DIuLdV6djo3rCe57+KSQ2VQci4FkkYMoNFMHwwaTcRO5 dPspiBS8e2tWzYYHkoCepIXuEFrj5IcPeKSnw6U1f3R4WKwZQrSDRdI1mqg8bVX/JyXtk/ CqH45PUlw0zRWZEW36FYmnO7ZLYLdOQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-kuEKK66eNVepqUcCnq5jwg-1; Tue, 02 Aug 2022 16:23:52 -0400 X-MC-Unique: kuEKK66eNVepqUcCnq5jwg-1 Received: by mail-wm1-f70.google.com with SMTP id t25-20020a1c7719000000b003a3564fa721so6473072wmi.2 for ; Tue, 02 Aug 2022 13:23:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=hHWhRmPR1pZp1I/u9ioQ+8YdKH4+dcWOy4DQBKc/PhU=; b=bb5LyVCu8ZOwaN8pAgTDf+Jk8DuvH67s8N5elkizG/+QPSQX3J5rdaKNIkXrbuWp7i LuxBLPHoYz1T+uemr5ucG/UEImovqHPxwMlSBx2TIrGmF0SNNV2sLWINsN7apNNJFCBv hwWus0/5VXEslKGiWfzBanKwjUOzQbGZfASDaxqVHYT0QHcQWfRtc7b3AzjX8n3qZwpM o9jHZkbuaNMXAx5lIIxp3XUEiwmitgzSDmX15eMfx/jBMzZNqbWq/56kXKkRygVO73E/ ha3BJdLAJ8OV7op0pHE9gZByr0eSFPXA9TFihVID8Vvo9ocQUlMyV3szvYImKp62f9gm 5KbA== X-Gm-Message-State: ACgBeo3R2tjzvNso5YyBnaASUWwpjfIO+PY62d0ONAj8tLvG2jrjepLh 3PTIE+5SLDejDnXnlAaD4p7Lj7b1O9lINnW7r+CPxtOfT5M5j4MruGBhJrxAG2UWaiYJWe+dt8Z Nn/3rHWpgi10= X-Received: by 2002:a05:6000:178e:b0:220:635f:eb13 with SMTP id e14-20020a056000178e00b00220635feb13mr6818169wrg.634.1659471831316; Tue, 02 Aug 2022 13:23:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vksWm/3+8rmd/sp3eh73T8iiQEcMgMRwpn/DJHIZzLLqst23rQ7ipqTx8/HuWW2AUJpX4aA== X-Received: by 2002:a05:6000:178e:b0:220:635f:eb13 with SMTP id e14-20020a056000178e00b00220635feb13mr6818151wrg.634.1659471830994; Tue, 02 Aug 2022 13:23:50 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:3800:8435:659e:f80:9b3d? (p200300cbc70738008435659e0f809b3d.dip0.t-ipconnect.de. [2003:cb:c707:3800:8435:659e:f80:9b3d]) by smtp.gmail.com with ESMTPSA id bg26-20020a05600c3c9a00b003a3279b9037sm25789082wmb.16.2022.08.02.13.23.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Aug 2022 13:23:50 -0700 (PDT) Message-ID: <24ffea6e-ca66-2b94-c682-48a42a655fd1@redhat.com> Date: Tue, 2 Aug 2022 22:23:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Andrea Arcangeli , Andrew Morton , "Kirill A . Shutemov" , Nadav Amit , Hugh Dickins , Vlastimil Babka References: <20220729014041.21292-1-peterx@redhat.com> <49434bea-3862-1052-2993-8ccad985708b@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH RFC 0/4] mm: Remember young bit for migration entries In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DBuGvOYD; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659471834; a=rsa-sha256; cv=none; b=QxuigyQcUsO96r5ABmMjSlCm+gYi1LBUg0slgRYDazev6JgRBnbAjZNLgODQLaCwXdf9SP B1BKHGqDotaU4M8PmGfcO6VQrFrDyZZh20lT1kejfQ+bV52yBiSnkUi4W722WUAsu6QVu2 cRPCO+z1mwtFBMA6PyZltl1C3xBLUqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659471834; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hHWhRmPR1pZp1I/u9ioQ+8YdKH4+dcWOy4DQBKc/PhU=; b=fgn1FzR/APT0braaSLIMzrm4ygShqGJN7v4oZ/POX6pZobaLr75qDZbivudlhrIQx+re8r 6rJKUU+4NS4LM8kmDOBl0r8vpCMyKbLSuDmsPnWkzVgA7A3QA19f8oo46hEd+D9flg58RP u0tT8YAlx5kUJ0HiVMPy6AMqpsQGLG0= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DBuGvOYD; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: w4wh8tb1swa5uk5oin9m3t5wmbrxhunp X-Rspamd-Queue-Id: 05C4518004A X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1659471833-835331 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: > I don't think we only care about x86_64? Should other archs have the same > issue as long as there's the hardware young bit? > > Even without it, it'll affect page reclaim logic too, and that's also not > x86 only. Okay, reading the cover letter and looking at the code my understanding was that x86-64 is the real focus. >> >>> >>> Besides I actually have a question on the anon exclusive bit in the swap >>> pte: since we have that anyway, why we need a specific migration type for >>> anon exclusive pages? Can it be simply read migration entries with anon >>> exclusive bit set? >> >> Not before all arch support pte_swp_mkexclusive/pte_swp_exclusive/. >> >> As pte_swp_mkexclusive/pte_swp_exclusive/ only applies to actual swap >> PTEs, you could even reuse that bit for migration entries and get at >> alteast the most relevant 64bit architectures supported easily. > > Yes, but I think having two mechanisms for the single problem can confuse > people. > It would be one bit with two different meanings depending on the swp type. > IIUC the swap bit is already defined in major archs anyway, and since anon > exclusive bit is best-effort (or am I wrong?..), I won't worry too much on It kind-of is best effort, but the goal is to have all archs support it. ... just like the young bit here? > archs outside x86/arm/ppc/s390 on having anon exclusive bit lost during > migrations, because afaict the whole swap type of ANON_EXCLUSIVE_READ is > only servicing that very minority.. which seems to be a pity to waste the I have a big item on my todo list to support all, but I have different priorities right now. If there is no free bit, simply steal one from the offset ... which is the same thing your approach would do, just in a different way, no? > swp type on all archs even if the archs defined swp pte bits just for anon > exclusive. Why do we care? We walk about one type not one bit. -- Thanks, David / dhildenb