From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 23056373BF2 for ; Thu, 25 Jun 2026 01:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782352276; cv=none; b=HuJ54eTEpIWbqNn1zFAqyOORuXAc/d2CPl3FarSjH5v7bCwvl2qC4m3CkN+qclJe6O555/0BkvJI0uSfHUDwtHkhVW7rJsz5Jflx5qLwCT5WM4shos3vDkp/Zmxlbz0ZPQVqIm3XCOsR+KrsEF4yZWH1o7Nt+8xbFNuBvGeVKkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782352276; c=relaxed/simple; bh=u9HU7XV4dq9bzcetrDqyjXjgnqFK6qdyibEIPnwFXAg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=k1hOe7SF5Aovdh8amrUwWL50/ajXpkltEu/SP6GzhFrkXxRCo/r4lMsgk+NVEf04YLTUcFDWVwKsGy7PiA7HNn3EFe991EtLBsQJmlP+wROFh2Z1rrrOeS5T9RHx0zKK7fqJGiIBnATa82sEVzvvFRmULvAjyAVItoh2qh0gR10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=surriel.com; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b=ODj1knlQ; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=surriel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b="ODj1knlQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=surriel.com ; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=u9HU7XV4dq9bzcetrDqyjXjgnqFK6qdyibEIPnwFXAg=; b=ODj1knlQNZAy0yrvLN7Z15LCBx ysHnlztoHQ7aTa7FssgKHAVYUrCSlGDZlIqDSnU6A1FCo4HgVN79HBGSPaJGqsjBs8GpHDZOGDorZ uscMtkjdU+sdyVwn8Udr2eE6h+tQOkvFhE1yp/7DUz/81EBfL83H87eBRNPt3vaLqJ0/tMpm2YUJa 8NxufMa51SKQmpUifkTE1lCC+HWUfMrltX3LKjivhDrgWa1i5AWz2RfORFjYoZ38wM/WdmbBXmRb3 sUT7AfUFQc6JyYa1VioPYZL/qIpaBdGMHWH6tWUvW0kP0lJJFbzGkGITBG191kWMqnf68ILtPojDv zusnuohQ==; Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1wcZF7-0000000043x-3LaP; Wed, 24 Jun 2026 21:51:01 -0400 From: Rik van Riel To: linux-kernel@vger.kernel.org Cc: Rik van Riel , x86@kernel.org, linux-mm@kvack.org, "Thomas Gleixner" , "Ingo Molnar" , "Dmitry Ilvokhin" , "Borislav Petkov" , "Dave Hansen" , "Andrew Morton" , "David Hildenbrand" , "Lorenzo Stoakes" , "Liam R. Howlett" , "Vlastimil Babka" , "Suren Baghdasaryan" , kernel-team@meta.com Subject: [PATCH v2 0/3] mm: __access_remote_vm with per-VMA lock Date: Wed, 24 Jun 2026 21:50:50 -0400 Message-ID: <20260625015053.2445008-1-riel@surriel.com> X-Mailer: git-send-email 2.54.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 Sometimes processes can get stuck with the mmap_lock held for a long time. This slows down, and can even prevent system monitoring tools from assessing and logging the situation, because they themselves end up getting stuck on the mmap_lock. However, with the introduction of per-VMA locks, we can improve the reliability of system monitoring, and generally speed up __access_remote_vm under mmap_loc contention, by adding a fast path that does not require the process-wide mmap_lock. This fast path is only compiled in and used when it is safe to do so, meaning a kernel with per-VMA locks, RCU pgae table freeing, the VMA is not hugetlbfs, iomap, pfnmap, etc... v2: - simplify the code, which should be ok because these copies are < PAGE_SIZE - clean up the code - fix locking wrt tlb_remove_table_sync_one() - hopefully address all the other comments