Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1570118rdb; Wed, 31 Jan 2024 02:44:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFm410zH75L0zMtbd1UU1lyP3NHVHC9UATw0A/1goAaMHv5uydfL4dCI99bo3dGFPW5kQYX X-Received: by 2002:a25:8682:0:b0:dc2:41f8:f4eb with SMTP id z2-20020a258682000000b00dc241f8f4ebmr1259516ybk.9.1706697859986; Wed, 31 Jan 2024 02:44:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWkWRVJxJd1VLtDoJku6jZTNXM5v2ZwTgTEKU8jUeZ0AEtiRoymkNbgPPnLqQQb9YLEAKIj0yvg1NS36RVrRg5glVfNHxRP361u5QlUtQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l13-20020a05622a050d00b0042a98c2228fsi8379315qtx.302.2024.01.31.02.44.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:44:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D11YdmbI; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-46254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6A3DC1C29E24 for ; Wed, 31 Jan 2024 10:44:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB6446A02F; Wed, 31 Jan 2024 10:43:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D11YdmbI" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 947C969DF2; Wed, 31 Jan 2024 10:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.12 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706697835; cv=fail; b=FHwvcF0wDY8X7JXxE4uADypxMBH+XkvFJktfVtwGBQ9I28lhPLOGrBvhV+X8cgcZTW11Utccpv87Hmugl5Jnx9fWHiAONTY20k/Ram/NC5rdTg7HUGimKeXpJbeAnuxR0JgpiA7GShH5Kaqzs0SkJ57ySQOj+g8mbEh436cBr4o= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706697835; c=relaxed/simple; bh=iPm5KQU4tHFCMavVHI/tSrCrpfgIiVLN6Qmyc/QzRfQ=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=LVEJzDckyniu7SJIjZ7HHlU5efyMfItFaxtaM7JWWom3HVH9etv4fj7QNVDlso6PJ5EKGsxpaak8am5ysdFv0bUqgjbves1iWsixOQObLZwJWcY9jgI3pVrGL/IcGvSWKVFR6xLfG8QQCNcfk3saC54m/Y6aBgGehJu29DJv3BQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D11YdmbI; arc=fail smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706697833; x=1738233833; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=iPm5KQU4tHFCMavVHI/tSrCrpfgIiVLN6Qmyc/QzRfQ=; b=D11YdmbIPyn7jaWIm7Ckq0vAd82Dnt52tMVa3fHL+dKdrXYa8FHuWKVe 9zDITILxAA73pEq5gAWv/Z9Gc21zlJvYgG/QJ8dW8UMjntf1EhJc+t141 SDiXzwuu16BJYxbv0PALLgz7lpvIm14wIjTiwXNBnUqVTZu92MA1dCfqn RIpUFh7Glt5frP0uSOfJ+Egah8msEvF5T64uUdQUpEr31R9uwKIjBvAsR Z69e7naI2Ts4pLdIcTCZYCAURVFG0/DtfRF6Rvcw3X7aszb1FfLdXzGCW SLAKR4TVSdzA2dYgBHGG7mUvdjy/WqybSekZsjkY6hBCfzvCZLAaeGNb7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10933938" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="10933938" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 02:43:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="961571903" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="961571903" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Jan 2024 02:43:51 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 31 Jan 2024 02:43:51 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 31 Jan 2024 02:43:50 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 31 Jan 2024 02:43:50 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 31 Jan 2024 02:43:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RfxetzFd8GW2i73WKrrNXLWRWktxkNK/63xephfMdaQXcVMtV0tf5Jvsvb2PoRPmi4UKk3OgRF5R19QE6iLOBVIfstg1EskZw7voegRV4XEgl8z+wIpxELaKcxIEUl3tDWGqS6nvswfoYs/aHOoMB+0jVg8Ag0NVJfZCwq1p5FC6bkIWePv8I1VMKtV9WabUz2lsKc2kFw73TvEqSCJgkZe+/V/Bmfyph80doL/c2e2IctvqkFNY+3OLrASzeEpWM//uSQGSkfunk7vr1+4kfyIKJMWkc72wpu100Ae19Dfi+kKzHVt84PzVIzxOV8bTym1LbpIcMWR4zblzUX0u2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xI+xlrLlZQfHefswm1G1uD2Ws1rP25MF2NEYW4cpBVM=; b=fruu03nCA25485ChAADppSg/CGKTNgO/GIvMs0G/PQA6fOQq7Y/FiBa/6OuEDvgJJf3eKRVfYfeax8CODwfXDqdXiwIsfCr6Dj+0CMWQ8Kct9wY5nmUkvNdJiYv7jDQeyIsjUFLOz5B1wsxnvopjZmSUM7DE5xykgX8DpU7Lvlw3c0aJs69sOIczLWjgFXGobhj9iqqIbhuAbDI/BD8vM3h2RsuIuN3fSxAf21983qefKOrzQ4jaSsL1e/WDF5B0jqAaWzIgllBKgyZLOgQrhjB4uWzK1qpOV3k11LnHuBYOxiI9C7hQSuUqRoiGy1URIKV0FkOxb7ZVEZhmrhml0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB4820.namprd11.prod.outlook.com (2603:10b6:303:6f::8) by SA1PR11MB6965.namprd11.prod.outlook.com (2603:10b6:806:2bf::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 31 Jan 2024 10:43:48 +0000 Received: from CO1PR11MB4820.namprd11.prod.outlook.com ([fe80::4647:3802:133d:8fc]) by CO1PR11MB4820.namprd11.prod.outlook.com ([fe80::4647:3802:133d:8fc%6]) with mapi id 15.20.7249.025; Wed, 31 Jan 2024 10:43:48 +0000 Message-ID: Date: Wed, 31 Jan 2024 18:43:38 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 9/9] mm/memory: optimize unmap/zap with PTE-mapped THP To: David Hildenbrand , CC: , Andrew Morton , "Matthew Wilcox" , Ryan Roberts , "Catalin Marinas" , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Michael Ellerman , Christophe Leroy , "Naveen N. Rao" , Heiko Carstens , "Vasily Gorbik" , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Arnd Bergmann , , , References: <20240129143221.263763-1-david@redhat.com> <20240129143221.263763-10-david@redhat.com> <2375481c-9d61-4f06-9f96-232f25b0e49b@intel.com> Content-Language: en-US From: "Yin, Fengwei" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI1PR02CA0054.apcprd02.prod.outlook.com (2603:1096:4:1f5::13) To CO1PR11MB4820.namprd11.prod.outlook.com (2603:10b6:303:6f::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4820:EE_|SA1PR11MB6965:EE_ X-MS-Office365-Filtering-Correlation-Id: 9706f2de-c9ff-4c6b-32ed-08dc224981a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v1OS0x4DZKtojMFHGso8sBhAVBk5EUpwHaVl89VFRUw5spqegECHba02BH5Qmgr4HAwW+jkhJ0/1bihTs+eGxkcPJ+9l/Tz3h3IN+MgmPzTBR+lrpOY3tSDjU4SwBzgYbLbVtOx3FFCXT2K0/AIntjJ0jzCfaK5lfD9up66ebYlPFUjD+OndsV8YkfwAkgO+h0kU4ebb9L6DAcIVQXoUqUuciWcP3A/DAVLEV2wjIuczRuKjy3d+Il0jCAmvcKz6DMwFvSQm2ugvifSuSKDHUk/Um4dMYdNulwLAv5fTI33rJ0crjqfiZOBkzwyGCbs4a+mZxML0BzOKVOkpXYssPANCbNvk/HeXPopP46rX68EdUgkLu76H+wrpoYI1nWwPLxbZl/liG6REowW5NUPS1IiUWDw50rzqlvy2l/Sj22Nrm+cxZkQ7sKBQRv+y0+xL9YLLXW2k0gIi1iWRzmAXRrTVU4RP/i2q53ZiXDQ57fQUJLc1AfBnhlXweWIaKfmryYKERD99Sm6nAAAxCLGKO7UUIhWIkViFVOZNm0yGOxl/2yYsABwvKp0FJ+iaRroLJztE8OnzizIkQUXLVF3Hi9roB43BahdnkgoJcLJP6JxiH7bWow7iDEO7UXAuvzV29hutEdnZiTIos6kWzKC15w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4820.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(376002)(346002)(39860400002)(366004)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(316002)(8936002)(8676002)(4326008)(2906002)(5660300002)(31696002)(86362001)(7416002)(66946007)(66556008)(66476007)(54906003)(36756003)(6486002)(82960400001)(38100700002)(53546011)(6512007)(6506007)(478600001)(6666004)(83380400001)(26005)(2616005)(41300700001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T1BwcXkwYmNKOTMwM2Nzc040NGhyRTYyZEJtVkdTaTc3UDlqL1d4TU9oa3pD?= =?utf-8?B?N2VnUGh1ZzVWVnd2d1JDQTRIaUNzQ0tHSUh4Mysrb1hoYXcrOHJDa0RlcUlV?= =?utf-8?B?MVJrNmRQZFJQR2FkLzlCakR2bkh1K3M2RW9SYXZjUUQyQlZ6UFZGQmFGMWVC?= =?utf-8?B?c25RZmRhSTBRTGdDMitPZEIxM1A1WWlYNGx6M3lzM0ZQVklDUjUvVms5Zjdl?= =?utf-8?B?Tkk5SlhRZEdIY1JwSnF5RTFJeUhGQk5VSk45NUhleW13Qnd3clBmYXB0KytK?= =?utf-8?B?RGg0UjVoblpHYTZFZ01aZHcvSlZWSEtnam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8?Q?FG140XjI5sBcIVYyo9LGgiftP?= X-MS-Exchange-CrossTenant-Network-Message-Id: 9706f2de-c9ff-4c6b-32ed-08dc224981a3 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4820.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 10:43:48.5721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EtDIJe50qYmfE1/ZlNO+nXbnUoJOXLCzQ1MVygYor3/72vGAJhCYhlZ9zcdpFN1t6cwAiPibYzos5uShtpaFxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6965 X-OriginatorOrg: intel.com On 1/31/2024 6:30 PM, David Hildenbrand wrote: > On 31.01.24 03:30, Yin Fengwei wrote: >> >> >> On 1/29/24 22:32, David Hildenbrand wrote: >>> +static inline pte_t get_and_clear_full_ptes(struct mm_struct *mm, >>> +        unsigned long addr, pte_t *ptep, unsigned int nr, int full) >>> +{ >>> +    pte_t pte, tmp_pte; >>> + >>> +    pte = ptep_get_and_clear_full(mm, addr, ptep, full); >>> +    while (--nr) { >>> +        ptep++; >>> +        addr += PAGE_SIZE; >>> +        tmp_pte = ptep_get_and_clear_full(mm, addr, ptep, full); >>> +        if (pte_dirty(tmp_pte)) >>> +            pte = pte_mkdirty(pte); >>> +        if (pte_young(tmp_pte)) >>> +            pte = pte_mkyoung(pte); >> I am wondering whether it's worthy to move the pte_mkdirty() and >> pte_mkyoung() >> out of the loop and just do it one time if needed. The worst case is >> that they >> are called nr - 1 time. Or it's just too micro? > > I also thought about just indicating "any_accessed" or "any_dirty" using > flags to the caller, to avoid the PTE modifications completely. Felt a > bit micro-optimized. > > Regarding your proposal: I thought about that as well, but my assumption > was that dirty+young are "cheap" to be set. > > On x86, pte_mkyoung() is setting _PAGE_ACCESSED. > pte_mkdirty() is setting _PAGE_DIRTY | _PAGE_SOFT_DIRTY, but it also has > to handle the saveddirty handling, using some bit trickery. > > So at least for pte_mkyoung() there would be no real benefit as far as I > can see (might be even worse). For pte_mkdirty() there might be a small > benefit. > > Is it going to be measurable? Likely not. Yeah. We can do more investigation when performance profiling call this out. Regards Yin, Fengwei > > Am I missing something? > > Thanks! >