Received: from mail-oa1-f73.google.com (mail-oa1-f73.google.com [209.85.160.73]) (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 0AF38204C2C for ; Mon, 24 Mar 2025 06:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742799215; cv=none; b=lN2vuE9LmtM4aGu+60okfJvXmj+c/Ly/EJu+8fOOIscwlxhpf/o1wjQATSl1UZLrBPzC3WqdgMEaSO2tKIsHbGkJCklF6fNfrmUutHH9Nvaq9xInZNfIdwjl14E+A3gqQertpHkC4Pj+UvQg/zlIvjknUujeuvJXZEpxtLi3wQQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742799215; c=relaxed/simple; bh=BBod9XlyyDQ8D6adGtugfu8HDKv7/m/WFoETZ5Ucj84=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=uA3s52YksRz+akzpRJgphelLlnG2ar0Pp7ZP4RRP95DK5Wkim9NfdR6ulTiXTahU/VDLV2+z/O+ufzwYVmab4O2r2TMLP7GOTaX3I6ZSbA26lRM+l8Uy1PIwqe0O7K1ym4EIP6Nd2mZgR4iRFU2Yw0Igiq1TMTvTprpNBJMiah8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--avagin.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2PtjmPKP; arc=none smtp.client-ip=209.85.160.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--avagin.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2PtjmPKP" Received: by mail-oa1-f73.google.com with SMTP id 586e51a60fabf-2c2339b26fcso2685171fac.3 for ; Sun, 23 Mar 2025 23:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742799211; x=1743404011; darn=lists.linux.dev; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Ij8NrI5xZ43JBAGEthvNKWDZxxjZlhI2ViPlC5qM+Ac=; b=2PtjmPKPVcg87+3Paokw9tLDmpbIgpp1Uv7eNLNH+PZeEO0LggLXQwKxWme4Vv0zlE UH6FIOVbuzPBKWCOTeKqQxrSBuKtbW7KXzw3aVGUoQNEUEAxeGcriXgVWePvMd5y+czU eXb7goZdWSrL+6lVDBAZXUoDxvplfTAbL+axh6XAIHshg1NJOqAxztNUXKh1lZxiEgfi Ayg01BK7S6nSz5o+f1zkcsCs5OTq408Y/qM53ip1caPEgm5uQWhBWI+V2Fp+9zetinxn wjmtokxjbHMIYUn9WX3eznZhQMICPi8GY6QAagmTh3nwdaqX/eWQwMjoOgY6TAqpBbb8 zktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742799211; x=1743404011; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ij8NrI5xZ43JBAGEthvNKWDZxxjZlhI2ViPlC5qM+Ac=; b=B+FVuRSqoF3Hmn1mdYyTW9vc8xO8HJWoOYUBlW1U7wGLDmuC36lvqIys3vmu2Fxorp JB2AU42dwI+TYd7oHODCsZ6dTaWSOCvt1yPQYTLtPyLNjzJd80S3fXZI0Ir/b66vvgW5 pihsTsongzaFJGb0ukgXpXBTgfhgr9VVQuZOW7QII99My8jzDD9FR9m5y4bTl7B9wNrI hwU6dd5oJTMqc4BHYWlwqr+OvSSi+C4IdLaUBfEl20fRRfkmklE6KAQgryJ2VSoX5q38 duDI5yLw+lMAVU5RnwKOEgz2Cr/KEajE/01zTLRFfB2E1f8wECDQyiSd+xPPXXj9/mjk r8pg== X-Forwarded-Encrypted: i=1; AJvYcCXQ2adLkqA/n905R1hfG+0UGCSEMSCT4g0z7DJBcrn9D+D3LeSeSa4u255i/SYqFlJVWDrS@lists.linux.dev X-Gm-Message-State: AOJu0Yw44654vkfJ0PJ6RiKtGGN+m+6rDz/bFRoPUyjpTsoc2+ndLn5T +5EtbglmSoAr34jSw4TDC/0AiW6VwDqicI4XZpNgC4zrXV/X9LmlSredOoHe6QoTy4K7/68ZsON ZnQ== X-Google-Smtp-Source: AGHT+IHpdLVbnzsd3cNvYjM2o8eY6lwTbr3KBAgc79gozX2wYwWUwNW68nIoXf4IdVkTdg+SlaMY46oDTYQ= X-Received: from oacpc8.prod.google.com ([2002:a05:6871:7a08:b0:2b8:faad:4f1d]) (user=avagin job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:8901:b0:2c2:57a9:79c4 with SMTP id 586e51a60fabf-2c7805045acmr8278062fac.32.1742799211140; Sun, 23 Mar 2025 23:53:31 -0700 (PDT) Date: Mon, 24 Mar 2025 06:53:25 +0000 Precedence: bulk X-Mailing-List: criu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.49.0.395.g12beb8f557-goog Message-ID: <20250324065328.107678-1-avagin@google.com> Subject: [PATCH 0/3 v2] fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regions From: Andrei Vagin To: Lorenzo Stoakes , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, David Hildenbrand , Shuah Khan , Jonathan Corbet , criu@lists.linux.dev, Andrei Vagin Content-Type: text/plain; charset="UTF-8" Introduce the PAGE_IS_GUARD flag in the PAGEMAP_SCAN ioctl to expose information about guard regions. This allows userspace tools, such as CRIU, to detect and handle guard regions. Currently, CRIU utilizes PAGEMAP_SCAN as a more efficient alternative to parsing /proc/pid/pagemap. Without this change, guard regions are incorrectly reported as swap-anon regions, leading CRIU to attempt dumping them and subsequently failing. This series should be applied on top of "[PATCH 0/2] fs/proc/task_mmu: add guard region bit to pagemap": https://lore.kernel.org/all/2025031926-engraved-footer-3e9b@gregkh/T/ The series includes updates to the documentation and selftests to reflect the new functionality. v2: - sync linux/fs.h with the kernel sources - address comments from Lorenzo and David. Andrei Vagin (3): fs/proc: extend the PAGEMAP_SCAN ioctl to report guard regions tools headers UAPI: Sync linux/fs.h with the kernel sources selftests/mm: add PAGEMAP_SCAN guard region test Documentation/admin-guide/mm/pagemap.rst | 1 + fs/proc/task_mmu.c | 17 ++++--- include/uapi/linux/fs.h | 1 + tools/include/uapi/linux/fs.h | 19 +++++++- tools/testing/selftests/mm/guard-regions.c | 57 ++++++++++++++++++++++ 5 files changed, 87 insertions(+), 8 deletions(-) -- 2.49.0.rc1.451.g8f38331e32-goog