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 E71A0C021B2 for ; Thu, 20 Feb 2025 20:23:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F0B5280014; Thu, 20 Feb 2025 15:23:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A0EB280013; Thu, 20 Feb 2025 15:23:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61AE9280014; Thu, 20 Feb 2025 15:23:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 431B4280013 for ; Thu, 20 Feb 2025 15:23:21 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0B942162EB9 for ; Thu, 20 Feb 2025 20:23:19 +0000 (UTC) X-FDA: 83141447718.29.2533F22 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 71764140021 for ; Thu, 20 Feb 2025 20:23:16 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MzYxYkZD; spf=pass (imf23.hostedemail.com: domain of luizcap@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=luizcap@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740082996; a=rsa-sha256; cv=none; b=QRzBC38V8TPYr8POQ+7pJQEVi6L5MS77zXw3W8Hy6QwH422O2er5Y8wrv9ZP11vlun/E6q UXX0uqKCJ8zKnUi53NQkFPlsoRmdF/Ml5WDscVNOHXdaB1lMNcUFY77eDE5PU94R9xBXhV 27QAvLGq+I82zxTAr+GoyIpuzfhhkuM= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MzYxYkZD; spf=pass (imf23.hostedemail.com: domain of luizcap@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=luizcap@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740082996; 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=8+QcFCOh+Hoz1nFZL9FYZfySC7E2K87mswG47ZWAA04=; b=6HC/cZa8bjevOJtbjhGlVdXyCFABUSASXwj2DhD7TG324SHI/S44YWGegd2mJlGu6MCmUD oRex6w8k6AfuY8khwbe0vmSh4qsA4WY14XAuZp1KRfAyDBFF3SN5MwLEQiEQJRlHXiNdqz 1Nj5Z6PJ7T7omUS0Z4suMmKBdWJHpGI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740082995; 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=8+QcFCOh+Hoz1nFZL9FYZfySC7E2K87mswG47ZWAA04=; b=MzYxYkZD0EeiYICy/2CI99G1tIldxwVTtyEs2fOwcoYTvEH0FpI4vlTzexWAGuXT0eMgr/ I+faMDfzCJbQ1RO4cEiwnZxxlMJolf8cpXQmlhwDftNkTl90UoysMg482ErmOjp+5OoHfV m+EMjIyEjzxgS2Yykd0cqQuESlkkcnU= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-6Fu50MEzPDeqeA6mUy25ug-1; Thu, 20 Feb 2025 15:23:14 -0500 X-MC-Unique: 6Fu50MEzPDeqeA6mUy25ug-1 X-Mimecast-MFC-AGG-ID: 6Fu50MEzPDeqeA6mUy25ug_1740082994 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7bb849aa5fbso287861785a.0 for ; Thu, 20 Feb 2025 12:23:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740082994; x=1740687794; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8+QcFCOh+Hoz1nFZL9FYZfySC7E2K87mswG47ZWAA04=; b=dqsflq+hAtrXgZ2Ur1CiZxY7misGNCOC1/hMkqTwBOUhkRaMpJQ8L5qDrfuRACnJnH AASAiikBLe8hmhd0NZhLW4+k0EyN6XCx5rFXKXg5C/NSgs9p1udo3puijTfEQPWV8ycP UoruwosDCvhNx5Wuu1W1A7zSib8ohhZZU6rP1u3Jq9Ip06JMqNz/WtDHjvBfBlk4xrs1 iIRVWRAW/+bgSevSLAOpUQCmuHUX6oPKyxYefT9loC5UqdjA7lvf5PqcraeKqOyLyszF G80xx8MyLMUqDpwRPuyFSkMIFf10PicMry17fivSFNL5eckLZwJBuovgMqwo6Y8QeeFn MQ+Q== X-Forwarded-Encrypted: i=1; AJvYcCUznbLqaEGMsOwbnNcmqYX3eBuifElVV1Hi9ZZmB74YNRc39kiRN/umoUhwxUMK9lylNLox2KMJyA==@kvack.org X-Gm-Message-State: AOJu0YzJZdHzbbpYPZG9WtJtp7Xs7UwfQXMR3wm/QhkDvX1yr2kLqmBS W0AX2DNPsD+Zkxtb3MweIOlQbdn1tV7TYo0Vcc5Re2XmVHzs3I+Me1zdn+3Lj8cpMbMGOcZmrv4 I/ag97VwP/9t4ihuySn/j4lgSBgzYAPNbvCLlzu+Rl4CusNFC X-Gm-Gg: ASbGncuGvhEs0QaT7phAQKXHY4d5L6iOjn3Xjmuvv6fKEi3c/FRXiEFXncT00qbsgTz mqu+Y4J3bf8Awj+cyRLrvaHVQx6hwE7C8ASoFDpABhL9+IEqVTSES0xFt+2sjCuRnY8iOEkSqyK QuXaXLkVwi0eItpPLS7dusDr8dDEMeEbCXfkT1MZLgtysm1xH65025z8St/WT6pXG1QQLp3nUcn LTep/Rv0wOhiSk9i2idng5WvIer1okrIdidIFrua6uyiZgX5r8wGpxHiBknNPJKcHJxl+m8jT0D TISM X-Received: by 2002:a05:620a:28d2:b0:7c0:a3bd:a77d with SMTP id af79cd13be357-7c0cef66cbcmr84578685a.46.1740082994242; Thu, 20 Feb 2025 12:23:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuIPV5XAd2U9v202aThWE9PS+XWLBByNvESCnnAfFIfyuynmEXFSHb4tYWOlH590wsDkhAbg== X-Received: by 2002:a05:620a:28d2:b0:7c0:a3bd:a77d with SMTP id af79cd13be357-7c0cef66cbcmr84575185a.46.1740082993852; Thu, 20 Feb 2025 12:23:13 -0800 (PST) Received: from [192.168.2.110] ([70.52.22.87]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-471fdca4cefsm38651631cf.45.2025.02.20.12.23.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Feb 2025 12:23:13 -0800 (PST) Message-ID: Date: Thu, 20 Feb 2025 15:23:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] mm: page_ext: Introduce new iteration API To: David Hildenbrand , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, yuzhao@google.com, pasha.tatashin@soleen.com, hannes@cmpxchg.org, muchun.song@linux.dev References: <20250219155212.9474b8c44bd58780a54c8a6e@linux-foundation.org> From: Luiz Capitulino In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JOLPcHm_QVZTz6KUs6sShrrgyFZ7oA78MtjFZYu81KM_1740082994 X-Mimecast-Originator: redhat.com Content-Language: en-US, en-CA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71764140021 X-Stat-Signature: j71iusz39173wfys1r3ea8587h8yofzg X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1740082996-834745 X-HE-Meta: U2FsdGVkX18bwURJel2GvQzxGnKHeP3dn1crR1WaagB0+kOsXPtgwOBUCTiO8fwogRV3ndXA3wR3kxj367gnhVtfSOrUW7K9MT43OSPJuuU9SvvNjn8JP+kzvN7fm4VdOEQyvB/aAjsAk0dJyzLT30cy3ThKi0SdBxD6GSN65zt8YvkeIpOyNGlD/hOFlErLfCprk4FedrG6Bc30K2MRQswPAYLd4Uc1zOiuiC4xlGB1EQrONvdfD4xuQFaU41ZPWqTMxl4pUTbDDfZRXR25bDezQ+70KDqu1hXahSjTRAxe2cBh6+43x2XLcpV3v5hyryp0MJ0CCK7o3OvR9fVkqBUjAro0AseFB85iZIa5JuImXwZRw1ZUrKkkSHVY8/2kK4ASDfo63WAFNLYbjHSfuC2r6gxheYWsAAkW9W4/kBTzQDuJ3IzYQtZ2DeH+O7pPJCkwM1BHkQl36lm2kaDWB0xYYtz/kKA2JFecEEBLUVC0HfAIjXe4AT6GkyLFLGekmaioLnRUeLdJxh9heWvbyHB6ilIdnhoK5RWyiYxSdp1rWvH2Z42trZg9AIRHMW/thsanqxw2FE+YdfhlctnrKc6s/0m6kRERl0OGYSHyUu03kjBXOJRJ1MsD1z/cpKjaj4sD88A25PmnebgewFIxUWcfddSnc98r2yuFsMFL+GT0qr8ifBU05OklfZNnlSkykqdxCW+PQGzNl7eipfFaGqBGp2Rgr6NsYqq2YgFYsweLTeWStyRfBdVCY4LzobkqrDukYJ0UQPaoZJk34l6iYAOnWemG/GLEI6BXnNZ2AJyliiwzFNm6z/QoSL8hI89VQV89vQEYzrWUSzgYshXAfOH/UpeIVxLI5mjYVY8Ddy+U3VQ7JMgF1mw8FVSbiD0e0DJv0gmTLUqne7lJ+J/4ePPMSkKK4mEKjSgO/sytWdrcTiA79jwDhTJJokdWTmCy9bRnzblsv2JnpNyz4mE BGz6ia9l JpqGum/voJZTrSU2NfT2XLI0Y4Dse31zhq5lfOdXTa+bBwmYgRojlDToGbbuNdtcu1ZKmvDdz4MUFAl+nX++YKdALIZqzDj8JkASR6RuiP2ZtGvUQu2vsL8TSjITgrZ+i6W8Ge6GawDgeqzvv2gg49PwLNSLzYKv1gWWkJZ0r446m5Dk4Zc4MVBRxU68DBGcq462nK+XX3XvND/0VKUV2+gnrKPtPG7N46JX4LJEjIdYY7ufj550ARQolc6YE0lYbmJn3zFvyBUeCMt00PZOlKcnMX3ng6Zb286OKY/NyKCGy10VejgxdikRooEQo+q+4VRtkpAUega2iVwjg6QpwHciPeYELEYlsKlJ7kQOCkwxoxJF7GjSHgY/KukwM42Uu7g0HHZoBt8Kb5zlPQ4qcW+x2+eISDA7olpqOXTLO5E1H4qL1WYV6413Bys/cT17vOfLdqGhu0Te6WZLzhaj6QXOHAM6Wv50js55N 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: On 2025-02-20 05:49, David Hildenbrand wrote: > On 20.02.25 00:52, Andrew Morton wrote: >> On Tue, 18 Feb 2025 21:17:46 -0500 Luiz Capitulino wrote: >> >>> To fix this, this series introduces a new iteration API for page extension >>> objects. The API checks if the next page extension object can be retrieved >>> from the current section or if it needs to look up for it in another >>> section. >>> >>> ... >> >> A regression since 6.12, so we should backport the fix. >> >>> ... >>> >>>   include/linux/page_ext.h | 67 +++++++++++++++++++++++++++++++++++++--- >>>   mm/page_ext.c            | 48 ++++++++++++++++++++++++++++ >>>   mm/page_owner.c          | 61 +++++++++++++++++------------------- >>>   mm/page_table_check.c    | 39 +++++++---------------- >>>   4 files changed, 152 insertions(+), 63 deletions(-) >> >> That's a lot to backport! >> >> Is there some quick-n-dirty fixup we can apply for the sake of -stable >> kernels, then work on this long-term approach for future kernels? > > I assume we could loop in reset_page_owner()/page_table_check_free()/set_page_owner()/page_table_check_alloc(). Not-so-nice for upstream, maybe good-enough for stable. Still nasty :) I think Andrew wants to have the quick-n-dirty fix for upstream, so that it's easier to backport to -stable. Then we work on this solution on top. > OTOH, we don't really expect a lot of conflicts. Yes, I was able to apply this series on top of 6.12.15 without conflicts. Given that -stable does backport a lot of fixes anyways, I would push for having this on -stable. But just to answer the original question: I can't think of quick-n-dirty, but I can think of easy-n-ugly: 1. We could add a check for MAX_PAGE_ORDER for the first function in a call chain calling page_ext_next() (that is, bail out if > MAX_PAGE_ORDER) 2. We could replace all page_ext_next() calls to a version of look_page_ext() that takes a PFN But all these ideas have regression risk as well, so I don't see the advantage.