From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796077530; b=tdUMbjGAWmj+OiTjrLV0O+ElKxaEsuIkFK+2GC1LnhB6WJcJ+TvHq++B1mTpmQsJ3kuK 8AEI35hj5Q0t9RBd3xhGBlxqwKQ9+EFU3UmNhuK6GfS89QiY7ncHU3HYWtFuFUyTxXoDJ 1bDmCJ5EA7w5Tpt3Q6Ugk11S6m0lH217GKSbHCz7xcyRXcNTnJ96D6PulZvwAN7nkRdb8 Cej+fK2FFqN16Z1av2dViYrChs4WwfnxL9IwVOqL0CVjNljqYOQLK1YMJxkJSknKU5lm9 wKi0blcLNltBfu91ag2JysVUREI4EfkppsstL/gmYxLV+b8AcxdxEzYNk0akxjR+o5Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796077530; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=mi140XFqTMo30Y9k8INQzeOJfIliSu+CW5LSpEJhApI=; b=O4HL66pgmi+E7WkwKr0QI/BMXc1bh/BAxTnL+qJyGuMbO4X6EeGWcK8y7sqhn9QGLi5Y 1RgZDwY7dXmrnztzTN0fw53N0qZPxJ/dTEr0cZhlFtFj/bn9e/2YURUig/JqKuXP+8uqF gpxMo8YieFL4vlSRuJCRJ/NaKSx6a58jPlvOfj4ZfUOgdrmmPYIzjxc0QYhpu0BygezIP eCw/Akh1i8J25ovsUJa+mp41580SzIOO+x2ZsOD85htgeL59RPAb0zTjA4aWQ/LBxwoQL 0XB6AG9jqZ7sLOTQan5UJw7QT9rjRHm2utFMKjfMtHKeKFaF6yhGlcLAnP69LE8CEGA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=epjk8Kvw; arc=none smtp.remote-ip=209.85.221.44 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C04ED606A31A for ; Mon, 30 Nov 2026 22:25:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C04ED606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=epjk8Kvw Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-4c3f0acc1easo1338563f8f.0 for ; Mon, 30 Nov 2026 14:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796077528; x=1796682328; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mi140XFqTMo30Y9k8INQzeOJfIliSu+CW5LSpEJhApI=; b=epjk8KvwhzyPckT3BvJFEerG+sd+4en3zbXUP0qIEE+ptFC1iJD6uFDsX14T6I0/EB b0SiGC2aVNzB3l1gF2+bH3V9D2inCYPyvh33eINreyOPIiOuqb4Smd0s1zn8QBY7Yeql kkky6z6byT0liegXPq6Iu6wZ3sIZ86NoC51waLUh3p7Dr7wLF0wv7VH2wggFJ1ol1ZCo 12NO2OUqhPozC6uclhY0Vzj5dB2fXqvmSzVc10ITWjtOYaLnMFmtTKHn56HfeDY0uOo/ 3eFEequImfZndMLwb7HEsfmOMDNvxHYSsiEThQg0HF6GYfDl8ONPYwxC1l2T6kOuAb7X KXkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796077528; x=1796682328; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mi140XFqTMo30Y9k8INQzeOJfIliSu+CW5LSpEJhApI=; b=yQylrs9FDpo2+cLKgeIYcslq0cPgmG73eBooXesVCiYAQPHjK0Rgj4uxV5HamgD9Di igkc9WiWOPi+K2be2gAcow1UGOV1R4oNSbSs88bwmsSaj3FLMxy2Xbg7EODxhzuHFdQG aGVhbyHdXH4mR7qUasSBpU6BmirhqsUVEx6BsU9BGc8iFUImXYWHgHrlRw3Xj1fp1T8Z G42h0mcjB10N9y2oJBVsd71Uqbc0b0Y5MQg4eCCD1h617+l5lsGjfBc3TpAnLvUaM8BM 8NnhLQcbJ2XW9iUIxK1/zdRLMVyR83tXnWIxujqjEnPxMUbSspKWr5hwgUsqXrDVDOfW YYww== X-Forwarded-Encrypted: i=1; AL+hErFBOqe2P7GLynN8E/Q96TgbNkRqTjMbE8Jd+iWwRgwAlK1NhvMQu/OXkSU6W2vNF4s1+BHD9ayNikKxlcdq@vger.kernel.org X-Gm-Message-State: APuU4Z/3G/4coIjIWRz4hLLTJA884609dM1/k9hRJWLo1IeTVsgnyIyT +4A9v75NPFKJrcXwW0zIrxUhuHN8ofUBCG02KEn3pP572cf6VANa4tY9 X-Gm-Gg: AZFdTZeHHITxnH6kSKek/2bFRF6B7OKzvu18K/oAVQe+//6L+gzE7zb89/r6tqj3cOJ LokLYGFdOz214PSjRQCN7bFVO5Tf8jNix5tKvGAQLjcVZTJeZqRUrA7OgPq7b9VCbYq4VsDZM51 LgVv9MgtGhv4GDctAO02m2t9/Wc40hdshLTBD+f6HzySW7iAyzsZfP1fhYYbMMI/NyGs00M9+M2 2VmOrlvilXBaLC5NHsIT195HHVjYT+V2zGbtdHQz88q7C8sWSRsfLTnMl1UyhXB1dWCeYQ5yZkY r3Ql8BpzoRY8MIjI3te6wNxsjLzxTwOA86St3BoeCSH9VUdsvk/zU3KkqT7dFPsw6kImT7S5ooV U2moUy20nLg+ziBPUUk7fhJ4OrXAEaeY2quvr770PB3ZTMJM131J6YAhn71Or33m0u0w0py81Oz OaQEbAxcS24uX/TYXXNcVPS/WzPXxecd1ysiB/Zq5bAbF+DZDFOCDNxqdT2+xjltpojT5Cy/bKL 4R+AS/XLPQP17DhRnNZss1Iei4Aif+4WtzXny+1zwX47e+9S3Byb/m4uUsZhtKwIPkcFhHoZ+hE ZQkGkyvHFW77jpepXWxeHPgEG4kJByB+6w/CMqXgwgOmDh6zIeEv0nep X-Received: by 2002:a05:6000:2211:b0:493:72f7:1d5b with SMTP id ffacd0b85a97d-4aa5b235116mr74870747f8f.29.1796077528115; Mon, 30 Nov 2026 14:25:28 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab658e2d1bsm69314642f8f.8.2026.11.30.14.25.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 14:25:27 -0800 (PST) Message-ID: Date: Mon, 30 Nov 2026 23:25:26 +0100 X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] mm/memory: don't allocate in finish_fault() with the folio locked To: "Lorenzo Stoakes (ARM)" Cc: David Hildenbrand , Zi Yan , Andrew Morton , Zach O'Keefe , Hugh Dickins , Kiryl Shutsemau , Baolin Wang , Dev Jain , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Barry Song , Lance Yang , Usama Arif , Vlastimil Babka , Mike Rapoport , Michal Hocko , linux-mm@kvack.org, Matthew Wilcox , Jan Kara , Johannes Weiner , Rik van Riel , Song Liu , linux-fsdevel@vger.kernel.org, stable@vger.kernel.org References: <20261127091344.113688-1-azpijr@gmail.com> <20261127091344.113688-4-azpijr@gmail.com> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/30/26 7:52 PM, Lorenzo Stoakes (ARM) wrote: >> If the folio can't be mapped with a PMD, return VM_FAULT_NOPAGE instead, >> as we already do when pte_offset_map_lock() fails. The retried fault >> preallocates the page table before locking the folio. > > Is that safe from this race, or does it just mean you could go on a > VM_FAULT_NOPAGE loop again? Maybe worth mentioning? yes, the retry preallocates, so it only loops if the table gets retracted again every time... I'll mention it in v3. > It feels like the pre-faulting mechanism is now a sort of best-effort thing > since it can't now correctly detect if it's necessary or not. Maybe worth a > comment at the point of pre-allocation saying that? sure, will add one in v3. -- cheers, jose a. p-a