From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90C06CCF9E4 for ; Tue, 5 Sep 2023 23:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YDn1zB2hCUde3CyvZeBN+6yQvfJm5MuUQCU7RdZAKOc=; b=iDtb/N0EcTdTK278ApcA+zEIuP Xt534WBA/nXPb+rZylH2y3UbwSnjTTEA/vOEoVa0TBllCMMaLm0DvGcUYEWQMjCYmvFV79WYYkynf d0Mvwv9vuEnaQ87NqsrYjSjn1xZeUDgA4Z8Yf4oMzyt4BmfZaNTjqHkfDwRKH9onoN3KM7TaW+8jy hjLtc9sqH5NuN4G1/yKCSV9ioR/7dyu9NCJcT1sP2fzwe9SZu7rz42xMPyEl5r44fvFvVHTZQGOsn I0sagDOJ/GTRCO3C9s63kKuaF67wnpTFIO8nE9Io53jT0IV0aMtECzDJqnPRKsksDiXnfwOSs+1wD OarrdQ7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdfuR-006vXI-0y; Tue, 05 Sep 2023 23:56:39 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdfuN-006vVT-1O for linux-arm-kernel@lists.infradead.org; Tue, 05 Sep 2023 23:56:37 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d7b9a334ccfso752944276.0 for ; Tue, 05 Sep 2023 16:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1693958193; x=1694562993; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=BTMdUX0G2lv2+kU2WiYySTJObpffzgV002stI1a1W7I=; b=3KTLkLQT2GT42S21/bJ47qRUytbK85BWDrzaobRMKFp8t7rOGMz20vTTvq97vsfYPj JvtFHjxHnKSp+wGYjyfE3zMDJHHHLAKka1YLIiXDXDz/PJMnSQUUJWPdaf+dYZWCQPd2 dxNpf8OZlYz/UmzUNSA7KeVlHgNxS2hgibeNFTPZvPkKa/KvB9Ab3iHs5WxJCkAtwYrW qsOfymuxkpQIB+3bqy3xDrlDMQbXScUbUi4JPH1hr0NCZ07215eOxEsoq4kNSr7mNhvl VTgiJr/xVZRT9+DgsR7493NYIjYCbAxtaB7/PUiLCd+AgeY9WnDMlzQOrEmlv19syWup sitw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693958193; x=1694562993; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BTMdUX0G2lv2+kU2WiYySTJObpffzgV002stI1a1W7I=; b=N+31wqZGfPbaaE8eKB3GUeb5gvI9O94/8PgGtuJHJkirm9yUotrPFOS0gL8314hJGK vlaAMp+aU7ZuLdZCBEndfpZQAWjlQxarUXY5GxK4suoZ0AYBh/6Eg9zIHhTGSrq9jVfk m2EYbHngBwdBZGYN7xsszvyOC9+4sdmrMH2gcUuMMeRhi0o6T/ObkVy6+YdNOFMXaMcX W1CX8WJtKRBJQu6S1LxVY4jtvlxf1lHjcv+hrQyFPiIAFqdqK7xgwutzEv3gaQZSV2Vr mXkE/kiZgGgsRSGkc21SOb8pkHmewuQwhKrY2P7E4KJ0la+KlTvWPE94sCHs85rYQ7Hs yD2w== X-Gm-Message-State: AOJu0YygY0x/NdFHtqHPNWeHNdeYFxEomwn8xvFNb5bvpCF1+LsZR1CL uWBlpIY6AG8oG03r1sCv9WvyujNo8U0= X-Google-Smtp-Source: AGHT+IGHRLIyxOEOlqNogao+wtJt3d7D+zZNTRSCijTepfZz1QuZZsrU81NGe3dzgdfi+rQuqyfdUQCuPic= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:4211:0:b0:d7e:c4af:22d2 with SMTP id p17-20020a254211000000b00d7ec4af22d2mr293199yba.4.1693958192804; Tue, 05 Sep 2023 16:56:32 -0700 (PDT) Date: Tue, 5 Sep 2023 16:56:31 -0700 In-Reply-To: <20230901082025.20548-2-vbabka@suse.cz> Mime-Version: 1.0 References: <20230901082025.20548-2-vbabka@suse.cz> Message-ID: Subject: Re: [PATCH gmem FIXUP] mm, compaction: make testing mapping_unmovable() safe From: Sean Christopherson To: Vlastimil Babka Cc: ackerleytng@google.com, akpm@linux-foundation.org, anup@brainfault.org, aou@eecs.berkeley.edu, chao.p.peng@linux.intel.com, chenhuacai@kernel.org, david@redhat.com, isaku.yamahata@gmail.com, jarkko@kernel.org, jmorris@namei.org, kirill.shutemov@linux.intel.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev, liam.merwick@oracle.com, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mail@maciej.szmigiero.name, maz@kernel.org, michael.roth@amd.com, mpe@ellerman.id.au, oliver.upton@linux.dev, palmer@dabbelt.com, paul.walmsley@sifive.com, paul@paul-moore.com, pbonzini@redhat.com, qperret@google.com, serge@hallyn.com, tabba@google.com, vannapurve@google.com, wei.w.wang@intel.com, willy@infradead.org, yu.c.zhang@linux.intel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230905_165635_469591_72284465 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 01, 2023, Vlastimil Babka wrote: > As Kirill pointed out, mapping can be removed under us due to > truncation. Test it under folio lock as already done for the async > compaction / dirty folio case. To prevent locking every folio with > mapping to do the test, do it only for unevictable folios, as we can > expect the unmovable mapping folios are also unevictable - it is the > case for guest memfd folios. Rather than expect/assume that unmovable mappings are always unevictable, how about requiring that? E.g. either through a VM_WARN_ON in mapping_set_unmovable(), or by simply having that helper forcefully set AS_UNEVICTABLE as well. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel