From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381415; b=VLQgh7hHWg89xo5bkqmKCjrrnjYGfaDbgxxIjjgqcHsjv0gpvVbhpfo+mM3IGM45FIWH 32WGwN4ob+CdlLO9GWI2G9yr9PWQfyrJ26j3MS67PkAOEH/DK8bZctkGtFSyXrsPSk86b MLyDz6aneJN7b/f7ibRJSFMHWxxISgosmtvirirLVRyhsYRAIMbzBnEijfdaHrmAp7ZIF L7dPGwAn6F4CQV1VSEbD2p633H5hasPDKlq2SbuePrCiUyysZWNsQ8HjMxbuZRZuMBc2a r9G/EJST/WifvT4Tlb4zRKcqI51TfkRQl6vTQlJZavzmidO+R6ngpkrMNyczavHYTbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381415; 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=pknAtBri9I4eJ1n7ZYbJNbNyFHupqD4EAQU9bV952vk=; b=RNm3UkPWknN6mTUIKU8IC7h96t8J5Vt775WfDrvO94ji6OJX5cntPwlngeSAPHbqgVtD gADB3qFXtQRmCP880lP8B4JWqYo3fTYMkEGCzgs5FmAs+uRZLjPveId/YKIJjinh/5mCz 0y8fTLmJOE86EaYApsQrWmniDSVQwd3Ccmk1s/j4J0/MkYS2uTuWR9zRgwktReoBj4no8 i/KnUgezYsauGFe5JTEBN9CbB9LDqVkx/s9U45oCAQZAfNsFHjX9DnkDviQ8GlAg7Mxjw CgxWKsimNqjcwU+g3TY3LcfwFT6lN8fomoldCEn+CTdiHnfVjKV9y2oOYEaWrBeSeyw== 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=ZeyjwPg1; arc=none smtp.remote-ip=209.85.221.54 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 A4940606A336 for ; Fri, 4 Dec 2026 10:50:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A4940606A336 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=ZeyjwPg1 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-48e3b22e971so397276f8f.0 for ; Fri, 04 Dec 2026 02:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796381413; x=1796986213; 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=pknAtBri9I4eJ1n7ZYbJNbNyFHupqD4EAQU9bV952vk=; b=ZeyjwPg1mOfkj1z+Q5y/dm6apqD79TZGdRuSJl2EvDV+XRxTWl/kW/TU/CG6UtYHSz rlUnxU3dbTDd0TNGN8aJftGbiHGhhB4ySBywAbi/qG67+7AZLXQMmPEBZXya7N5SJed3 zC1eaEWq4uZxCFX7QcCbmHxGtR0oUTSPij00oYinL4/52PFXjuw+1+pv57djKb6Q+HCt 466G0SRvZIu/Rtp6nLYCot3z0fWfdZ3BRsAyqfYsKbVd6KSzDDeeY+RpQJ/XICeKfG6V gNyGJaMw3Z1utYUCC+2Mm+8S9JY3TDdGUYcx8Qlp/kFB8PGd3CYgPNn4xsGUB6QR2yfG oGRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381413; x=1796986213; 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=pknAtBri9I4eJ1n7ZYbJNbNyFHupqD4EAQU9bV952vk=; b=uRz5rd0szgbOd5NIEui8UCstP59FILWDwv6mvVZaX41p9pRNOcPBoNoGth74+YRwFQ OdldSd1xwbayqA2dtsJX9T7bPIX785tiGi8bs90L0+QGe6XPj2I7mAUiNQytPMEI+5HV GpWmZkntA01riHnUPjyGTRfYorFiaMuzVNHwLYvDzN1qChujKoKNh5LNIKm7XkjTmKzI A2hnQmi8MUlGzCqrX4IpAYGjh3Qnh3H1xhXuL/GBRmZpWOeb71EB+XgdgE4Dt5kVFGWb Mr/gq8cn1D5bOFukqyKo5Zk+FEN6c8WNohjGtbqQRlB9itHURB81g7p7NPPDdq9rX5Kh wRwA== X-Forwarded-Encrypted: i=1; AL+hErGbrpudIt2ltAX6M6I1Y4hWJe3wyy5V0UCpoyvaa+qNop9bCjMCuTOw9plxfcpK0eWLAD+kXY9zGsVKsPI=@vger.kernel.org X-Gm-Message-State: APuU4Z989ALqQXnWdjH5ko+bcuLouisOtFvG4P1K/KHDezrfOwEYyFCx 7wt7cOC6F70J8M2HVyBO/MIZRS2XDIiz9H7YiYIHFSm9jF2a9rZu8ADl X-Gm-Gg: AZFdTZdkqM3n1De4f6eT9eqyfgzkWqIYahy/xCBR5VrfEn+LjxdlNAMg58bvwt+4Hxb Uz6YxVz+TV+nVkg9cPZtr6yJjmYfWCrobgyEHT6Ydy9sQ4nNd/ihmqlAwMKXSChDFV2L+meIR+f Q7fVnmQadzkV9v3fpG30gTDoIdoeQLRPhhQaDt95ZjaE9aqRoYxnBmwa1NaBhRajYnV99yIqjGV ht8CYOannRJtdgNXOLuBk6M4zSTrNhNQsxWtiPURL4nDBBlvZPQjyOeQIbtPTY7rwMteTpiritk kNot6yoica34X/r0D8nFkqwJjrZkWP5Eb8djk5Xw5UdY3RK7AHu5Aqw1Rjjtk03QO/D4tbL9wmA ilQXHk/6V+T5e9EdMD8vMCc5+uYjElgplXhrjlqr8N+NiLCN2pFIWlkK24Nry4kYj4Xjn08kfru 26CBIKGblq/3yGuoxQZpVM1RW1CYAwYXK9ZUa1uG9awLF0IOty8umhZemOugrYM/k0eQylPIeYH 3pbEKfLn64A+FuAAm33PzXsQ1RZC96UZKJEZhOa3IyXH2RaveLw0IvAtwb3KcY6IzKin/k669R7 2Se7TQGY8uUJuIYWb7tJZUoLm024H3ifEmFWsHWcTjZVtK2DYwEIAt4X3Z0QCxl+Y/+WBrct0da U X-Received: by 2002:a05:6000:1ac5:b0:4d1:2eca:5b1a with SMTP id ffacd0b85a97d-4d1ea3be8b9mr3236759f8f.38.1796381412973; Fri, 04 Dec 2026 02:50:12 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d17435e113sm4767028f8f.52.2026.12.04.02.50.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 02:50:12 -0800 (PST) Message-ID: Date: Fri, 4 Dec 2026 11:50:09 +0100 X-Mailing-List: linux-kernel@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 10/35] mm/hugetlb: wait for deferred frees before failing an allocation To: "David Hildenbrand (Arm)" , Muchun Song , Oscar Salvador , Andrew Morton , Hongfu Li , Jinmeng Zhou , Mina Almasry , Davidlohr Bueso , Naoya Horiguchi , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , Vivek Kasireddy , Mel Gorman , Hugh Dickins , Baolin Wang , Dave Airlie , Jason Gunthorpe , Andy Whitcroft , Roman Gushchin , Barry Song , Andrea Arcangeli , Lorenzo Stoakes , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Jann Horn , Guillaume Morin , Yang Shi , James Houghton , Rik van Riel , Harry Yoo , Lance Yang , Axel Rasmussen , Peter Xu , Sasha Levin , Kiryl Shutsemau , Christian Brauner , "Steven Rostedt (Google)" , Hongbo Li , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Andi Kleen , David Rientjes , Joern Engel , "Aneesh Kumar K.V" Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, Gerd Hoffmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Chris Mason , Jiaqi Yan References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-10-9bbeabb555d2@kernel.org> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: <20261203-hugetlb_fixes_2-v2-10-9bbeabb555d2@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/3/26 12:37 PM, David Hildenbrand (Arm) wrote: > With optimized vmemmap, we defer freeing surplus folios to a workqueue, > which restores the vmemmap and frees the folio, or adds it back to the > pool if restoring the vmemmap fails. > > However, until the worker has run, the memory is neither in the buddy nor > in the pool. > > Consequently, a task that unmaps surplus folios and immediately faults > in new ones can get SIGBUS. > > Reproduced by artificially delaying the worker, filling memory with > surplus folios, unmapping one and touching a new one: the task gets > SIGBUS. > > Let's fix it by waiting for deferred frees and retrying once if an > allocation fails while frees are pending. > > This has low urgency, as it requires overcommitting surplus folios under > memory pressure. No need to CC stable. > > Fixes: b65d4adbc0f0 ("mm: hugetlb: defer freeing of HugeTLB pages") > Reported-by: Chris Mason > Signed-off-by: David Hildenbrand (Arm) with sashiko's WQ_MEM_RECLAIM point addressed feel free to add: Reviewed-by: Jose A. Perez de Azpillaga -- cheers, jose a. p-a