Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2036284rdb; Tue, 20 Feb 2024 15:18:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqdI9cEiS9hJduirOV70dzAQUt2Ze3KUuNpFfcugpeDxmepHnpFScYO0YpV/lA+dlKefhf2xGFktvBAK/2x34SaOr5Iv56Bzp5RVbzSQ== X-Google-Smtp-Source: AGHT+IHYXJtQnlowbOTxXKUhrKo/WF7QmKTc+H7KyUOawFO217hvNG/xpIQwY1yptqDV/P/WAx+7 X-Received: by 2002:a17:906:48ca:b0:a3f:10:bf70 with SMTP id d10-20020a17090648ca00b00a3f0010bf70mr2170368ejt.37.1708471084722; Tue, 20 Feb 2024 15:18:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708471084; cv=pass; d=google.com; s=arc-20160816; b=vttrqMMGYDmU6N6bSadlFBcaVevV8GvICKTQohFIF7nT/iPObLcHkg6yRs5RIc+g25 1+NWSLGIRfLmUnpprcDZoKYA6oTstvXmBSY0IJVMq9wgi1ltQ0p850VgY1LsNB/ReVl9 93RjPapynchQUl1T+h71UsvcUitWituc0AYtyN/M+S3Zr7YCMA+CSobmOBZ7xcGqJVpk EWDO2gvDm9/L2XND2Syl+J4PYCFJqRDkt/2+0dZktrR+77TKMrY6ZvLSKipb3UGpXXX9 bmLLMVBBCzVu6NqCXo8BAWc5N0fTV5Hq/bcf/Nr6gxoSNfu+/2AviOkHiCmG3RFjhi6E bmjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=rEImZ5lR83XSeffxFdtCU6Dhfg9WnM4aetn6qhHi+JM=; fh=g4N4lZkFGOQs9eZ+YhR5V4YGLRojpV4hZZzrx8OfUSs=; b=pdSXttLw3dnfRcZNev+Mrx6JIxYTnfRpSdLSv0iKrEcxjUxtvH7Y8E6N4vBPy6UAdp Gj9gm+blQ3pft9FDXRvK1sMQaMZk0NcIfcBFW1UUaKGkglFnvzbkYVGNl/Z+xYHKq/S0 ZJoBMiMeGMQCMnH8bTTXazPImkgOjvc4k51kzEHIUmBjxLDoSfDX2SjgTXbTVDbmYBkN UyeR+IIzkU3rVNiWYToWTap4r7UHmVrrmsJ2gXErNCYKHFZDtGYt+/lZRxjLBn3p6a3H tMqWR2MIrDr60FXOmw9wLtJ7KA87baD8ZeN/iL8PDZQG6UGedTPIhdN4/y5+m0CtR/0j Xuow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DGq0h9Rz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-73811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mb19-20020a170906eb1300b00a3e891b7606si2408986ejb.971.2024.02.20.15.18.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 15:18:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DGq0h9Rz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-73811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 78C301F22FEC for ; Tue, 20 Feb 2024 23:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0166C154457; Tue, 20 Feb 2024 23:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DGq0h9Rz" Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C98A076C99 for ; Tue, 20 Feb 2024 23:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708471077; cv=none; b=AkjueHQyiXP3aZTHBd7yDwCQyc9qf74tIXPJROi2X/20Y1CSKVb3gLU+VvX1hciaMS+lbAUStGro/MFKA6A+jc/Lj8ZxwD/nbJMR91s/TpE0ocyJ3XGgaH+3DodHnSRGmL/aPBnIlpxa3iefjM3FJZqUwdEwQVCg1vTXlMjXkSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708471077; c=relaxed/simple; bh=3oxOrolpFav1lXDBdahABpOqzElyqu/oXG1o5ff2lNc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=n0jOMiPYW28bWvoG4jamgDJIO2hAm4+rcvI4NfQjoupOKAE5ciIILqqNcwCOPi8cQ/WQQgl1UsHlj+SF4jGYe/w2YwIsegS9Rzrb0I7Ym6FBG8HFnXUKXHXGDAbtCU0qfPqBaYc6yek55KlFJucDN+i9nTeMPkR4q7ISWS7mqY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DGq0h9Rz; arc=none smtp.client-ip=209.85.215.176 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 Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso4625306a12.2 for ; Tue, 20 Feb 2024 15:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708471075; x=1709075875; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rEImZ5lR83XSeffxFdtCU6Dhfg9WnM4aetn6qhHi+JM=; b=DGq0h9RzlVTPu4eBcz7Fgi167rNXPPs3zsWGvqS18JgaU1tx+Z0ms5z/W2mdI1T8gM rYytreIOg7e525cFPskU0dFZQOScw77QZtCvKOt993zabRL3RQaShNGBeNuq9TvjZGLd KTjagPkFXhTVvuGrzv48PXhPPYs8MUFpB+hEbkfXEn03BIbdiUQeHWzTOcyViwk3XVqY FT+65C2WxcqLD7ynYxQ4k4vYOuo9iVp+aw8TlQ6vDPqsnRVoIE7cd4Q9nL3m4cclnlaQ aUMUPf4o2pZXLUDb3kTZBAf5Mf48Uv5fTLfvGJ2Lck60ClXo5x60hAIfeyIYCS1pLlmK ZnyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708471075; x=1709075875; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rEImZ5lR83XSeffxFdtCU6Dhfg9WnM4aetn6qhHi+JM=; b=A3mnJgb3Yn7ASrOn7FsPP7pjKHcKRKArtQp8ETICawY2pfgRXismQqPejCxuh7PD88 UK8zthR4ZRI6mzEXaJaVL59dQOLmLIepbmzzxN+eLj23LTH42N8qhSeRcEVGyOHRcpZM Z9zT7CtoTduZ37hCOtkD6G7y2m7apm0a4lT0ne8U2YfKLxPPmvDW67zY/xQhNVnejOYB qG/wAB4srArkjuGSF5YdWWFxp9FH5xUGfV47K0GlrRPseK6ya9xhYbVO1zlHC+XfLFUb JZ3RZW0CrTfZIDH1eDhoTvzgKVnML1NZhO3Tq/TrHir503yrcPeSuejJ30ji8DLXXCVK bXgw== X-Gm-Message-State: AOJu0YzYPnob6cZCgG0vMUJaP052K6VIC92RqSVcvkCicb+8JVt2TShg tSYMBnZG5Hn++Q86kmW9ql/HSnV11JqUJrD5un9LKpI3tCWnOoGd X-Received: by 2002:a05:6a20:869d:b0:19e:cdaa:83a3 with SMTP id k29-20020a056a20869d00b0019ecdaa83a3mr13296774pze.30.1708471075036; Tue, 20 Feb 2024 15:17:55 -0800 (PST) Received: from fedora.. (c-73-170-51-167.hsd1.ca.comcast.net. [73.170.51.167]) by smtp.googlemail.com with ESMTPSA id x16-20020aa784d0000000b006e13a5ab1e5sm5317803pfn.73.2024.02.20.15.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 15:17:54 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, muchun.song@linux.dev, "Vishal Moola (Oracle)" Subject: [PATCH 0/3] Handle hugetlb faults under the VMA lock Date: Tue, 20 Feb 2024 15:14:21 -0800 Message-ID: <20240220231424.126600-1-vishal.moola@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It is generally safe to handle hugetlb faults under the VMA lock. The only time this is unsafe is when no anon_vma has been allocated to this vma yet, so we can use vmf_anon_prepare() instead of anon_vma_prepare() to bailout if necessary. This may only happen for the first non-shared hugetlb page in the vma. ----- The last patch in this series may cause ltp hugemmap10 to "fail". This is expected behavior - see the commit message for patch 3 in this series. The rest of the ltp hugetlb tests pass. This patchset applies cleanly ontop of mm-unstable. Vishal Moola (Oracle) (3): mm/memory: Change vmf_anon_prepare() to be non-static hugetlb: Use vmf_anon_prepare() instead of anon_vma_prepare() hugetlb: Allow faults to be handled under the VMA lock include/linux/hugetlb.h | 1 + mm/hugetlb.c | 33 +++++++++++++++++++++------------ mm/memory.c | 2 +- 3 files changed, 23 insertions(+), 13 deletions(-) -- 2.43.0