Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp968911lqa; Sun, 28 Apr 2024 12:02:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXooUZxw8QGAHc+hoHCbCOSl8ogUUV2XTthHz98Bzukcy8k/zQHHgP7muDGf2gEd6UYAPqxNoz0hscy6NJjluUQPNOFfXVJTxhhn4Ezew== X-Google-Smtp-Source: AGHT+IECzEqL5tyiV0abERC+IHEY/XEqtKSKS+A5roZENEK6L+ENg0rfL8FpmNNz7ithPip/OR3W X-Received: by 2002:a05:6a20:9717:b0:1ac:dead:68 with SMTP id hr23-20020a056a20971700b001acdead0068mr9967223pzc.24.1714330931725; Sun, 28 Apr 2024 12:02:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714330931; cv=pass; d=google.com; s=arc-20160816; b=zc6aS7u6i0soxoJewhwi9wYQUJfTc95f104uG1kIXaGaB99xrhSUl9XhkhZFTvsK6M t+IgzXagOpaPXHg7isaDjbNz3AGqT2La9QmN5up+Az1vhnaO8iPqetpKBeBp3IsWbGJH 9PYxliMfD76K9hraF4qJGgOJ0Fc74rxaa9GXgkLAmcmWX47KLciY+a4nODQlme1d1IE7 z4OZYsmQR/HapHqvUgEsK+F7hjFhjE3nisdJPtmSYlUN1wKeTE/x/ZBCITIGj7ZkmyE1 J2oPbu6XUkjS0nuxuO+4mrj2e6iNBg+HFS5LONhEZ/vDP5nL1mUYsBQRJ968vUUW7XFg PVlA== 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=pkigxwzJ0pF/T4NqveAQpx8gjiN35IK7jok4Q5z8klI=; fh=1nWvNjjzhJGVSXYQ3qb3jm6lCJj1n9M1sKq2cMf2qqI=; b=PKrpEWb1y12bG3RYlBcfvabcQfiLQPplm6LKMnRzWrOUWuLG0x57nlgsvvdHiuDxAp uiHR+2bFY8qBjBCKoxkGsVNS1KVhkLNpC6VBtQNBeGXa9InCyQeLGaWETfKNWrXrXv9P f5Z9PbS06dbVh98ejzARmWnOliLPqKLy2759GuDQZ51Qw1WibrzkjMK8Tb+OD/8UrKly M+8k1yAO1HEqImWcctoHtoYr0qEa+PHsyvbqLwiQKKUf5/ygUigr5IbsJgcGt7yKKy9U 2f8YsAXcwHokx47ayji9qg1afBS7Kxj+ym27pCDN/R0hrZMH1QHayZod1gX7hzHbDYZm eCVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HWilYCzn; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-161545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 191-20020a6300c8000000b005f7b2fc9ddbsi16917850pga.845.2024.04.28.12.02.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 12:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HWilYCzn; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-161545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5EBD9B21131 for ; Sun, 28 Apr 2024 19:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33E187442E; Sun, 28 Apr 2024 19:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HWilYCzn" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 56E8E10F1 for ; Sun, 28 Apr 2024 19:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714330919; cv=none; b=qY0tzdrPSDWRTSWcsRIIji7jhGrGdlTPyyyOv9vN18Qw+TJ1mK0WjfOipyzJyCfnG1R7/7bZJdjbuNjYCKS+n9U28anCig7u1xg72xDzL0DVo5IrjgkZJ8zSQv7vfbG+DAJ5ykbaI/N1mR8ierDwBuJTWKBsJZueb2ZqwWiS5Mg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714330919; c=relaxed/simple; bh=RIQw26BWThK3J1ibTcR5IgYR08UTehW3GYYYG9XrKhY=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=dMN3sHBpKOLQ34zYfMhriP+trJXD5pmXOaUwNVAxHYC47ReQRLMHc4a4Nd5TiAjobd03H+3IK84ogv/LQPUDWvtYOsqRlynj0M2jBVHK2lyaf5NnYrpufmKOMGq6bETqyGZtP7s0Frn6Us1UdmDGAiuLUb87lTRLavCfc1gh0WQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=HWilYCzn; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714330916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkigxwzJ0pF/T4NqveAQpx8gjiN35IK7jok4Q5z8klI=; b=HWilYCzniiS/dajtY5AbmQ3AI6fAYAc1Ps3QbkQJaaQpO3ZiaEhHICnA0l1VfpVS/4CW4w RNba3rP4im6E3cglfZhV2VZlEHI52rDFNw/umLkNgxqEZkPLUwcLy2mId6y7K5tG4jIJiK j2lk+YxQROGbHX1paw0uBf1b5YdKo2E= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-cWRYfkhGO9y7x8siwRjuxA-1; Sun, 28 Apr 2024 15:01:54 -0400 X-MC-Unique: cWRYfkhGO9y7x8siwRjuxA-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-43a3632d56aso15798091cf.1 for ; Sun, 28 Apr 2024 12:01:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714330914; x=1714935714; 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=pkigxwzJ0pF/T4NqveAQpx8gjiN35IK7jok4Q5z8klI=; b=NHmi/ZD1QDYkt88rU61jklgFfd+JgIg/Ej2Stjf5iIhM4R17/3jHLTvDIYpiXGpGt9 sogFXZ1soX2kmcAu6Ypk+xLCudoq/Bjs9dP32msE7GxAcZIY7C7o9JGdeKAcFnFDL61W F2RHRp1tCRap1S+pc/tbmOkdeA20pluxy5qbbglsRxhtiI+fufHMlkoNbdwfH1Y+xuqE 3LfDEp7JPVaZywhwuQQmYh6dr/EXofdUnE6Z54Tlof/Xi7J42ZO7CSwUi+Whn9SV6V/J bZEbXZ3+z+ulg4r7l/gZPVfdulp6bqh/HQXkGXFGKRRSht/OHywa4jVimd0fP5JemCZR OYpQ== X-Gm-Message-State: AOJu0Yw3YUuSpHrmMh+/kmrxjCSGN3wb3d/mvq5JbMuLsMK1pQVdfmyH mXBU1z6WvHBNWHaZAkbgxfX0u4zj5ccOvsmiI9RL8Nvl+tdrjgirOB12euSgyu3bHQce+ZyBScS pEAigEKL2k2VF+Yaq22RQSouARJkahXx3+tybpLU2exRGdY7tKUZVnvjpdUlxNyrB4hwbK3wOns pjXkGX/mtuD79VNeopNjQcWJziH1ezWNNzwJDtA67O6wA= X-Received: by 2002:a05:620a:17a0:b0:790:e83a:e6eb with SMTP id ay32-20020a05620a17a000b00790e83ae6ebmr4022635qkb.5.1714330913873; Sun, 28 Apr 2024 12:01:53 -0700 (PDT) X-Received: by 2002:a05:620a:17a0:b0:790:e83a:e6eb with SMTP id ay32-20020a05620a17a000b00790e83ae6ebmr4022591qkb.5.1714330913186; Sun, 28 Apr 2024 12:01:53 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id oo8-20020a05620a530800b0078d693c0b4bsm9818152qkn.135.2024.04.28.12.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 12:01:52 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Christophe Leroy , peterx@redhat.com, David Hildenbrand , Andrew Morton , "Aneesh Kumar K . V" , Lorenzo Stoakes , John Hubbard , linuxppc-dev@lists.ozlabs.org, Muchun Song , Jason Gunthorpe Subject: [PATCH 0/2] mm/gup: Fix hugepd for longterm R/O pin on Power Date: Sun, 28 Apr 2024 15:01:49 -0400 Message-ID: <20240428190151.201002-1-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series should apply to both mm-stable and mm-unstable, I am not sure whether it's even applicable to apply on mm-stable directly, but perhaps not urgently needed either. Anyway, it'll apply to either tree. It also means cc stable is not needed even if I had the Fixes attached. Patch 1 fixes that bug in mm-stable, patch 2 enhances the gup_longterm to be able to discover such issue. In general, the previous hugetlb rework [1] on gup-slow introduced an issue with R/O longterm pin. Nobody yet found it in either a real report or test case, probably because our test case doesn't yet cover it (not before patch 2), and it's also a pretty rare path: it only happens with Power longterm R/O pins on a page cache that is installed as a hugepd read-only. Please read each of the patch for details. I retested "./run_vmtests.sh -t gup_test -a" on a Power8 system with a Power8 VM, with 16MB hugepd hugepd entries installed. Note that I tested exactly the same matrix before, but patch 2 will change gup_longterm test, so it's actually slightly different test carried out, and the new test (gup_longterm.c, when apply patch 2 only) will hang mm-stable on Andrew's tree with that 16MB huge page. Thanks, [1] https://lore.kernel.org/r/20240327152332.950956-1-peterx@redhat.com Peter Xu (2): mm/gup: Fix hugepd handling in hugetlb rework mm/selftests: Don't prefault in gup_longterm tests mm/gup.c | 64 ++++++++++++++--------- tools/testing/selftests/mm/gup_longterm.c | 12 +++-- 2 files changed, 48 insertions(+), 28 deletions(-) -- 2.44.0