Message ID | 20220308213417.1407042-6-zokeefe@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CFB8C433F5 for <linux-mm@archiver.kernel.org>; Tue, 8 Mar 2022 21:34:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEB2E8D0008; Tue, 8 Mar 2022 16:34:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C9C638D0001; Tue, 8 Mar 2022 16:34:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3BDE8D0008; Tue, 8 Mar 2022 16:34:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id A10418D0001 for <linux-mm@kvack.org>; Tue, 8 Mar 2022 16:34:57 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 785588204F for <linux-mm@kvack.org>; Tue, 8 Mar 2022 21:34:57 +0000 (UTC) X-FDA: 79222524234.10.4A8413B Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf05.hostedemail.com (Postfix) with ESMTP id 11483100007 for <linux-mm@kvack.org>; Tue, 8 Mar 2022 21:34:56 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id w68-20020a62dd47000000b004f6aa5e4824so303312pff.4 for <linux-mm@kvack.org>; Tue, 08 Mar 2022 13:34:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=YL7Ifg74lmqADJcFyq3Dg19FCQB6Gp8A8NRremZcd8k=; b=J/04UN8xXO6PfB2dgwV2d+cYmhx8EAJbGt2Dry3KROTmDlbNLWMvFSL/Rb+KplutcF cMQICc3NSHW+Iq0cFf6+a+X/d+zM4oVo0qV9RAipPXhx7TPxgZHtYyEGKPVzX05/S6W6 ZjYFHCWn3HhovCnEGljl8iCEJmW28ZPHrqUJaJgbBl6DfCj6tCg0pYLQS2ZHxpAfq/Ho ZTs58hQnbCHXJbdg4FvXZyewha6Gs7DIfM+UycLtr7zaQ/SQgRAaWaZsnybDUMykvGy6 I8EeNTsd4NUzKIBptivL9ZtFVO8W04h25MwkeUsS6jpOCmPVTMJVCYMOcvvNEk/f4EsE +MDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=YL7Ifg74lmqADJcFyq3Dg19FCQB6Gp8A8NRremZcd8k=; b=MR7Yo8Gla/0Vl8FnK6oSMGc3XBIDQQF954Bgw3dBCwZUtX6bG6KDRU59bWRM2jesJr C1M/sD1UF9YYmaCrNyYzbKC3wbA7Txkfn2B+qOZ+7+Tj/IaZsCRQT+nS3pUmvcXZw8OP gmfTXZh5SS1O2p/Jvw0mJya8XxsLuCUT+Z9UWakENMwxRgUrKNeuzvG+dkBDpqk5CNuX AIDxroxUh7feoIvgm/bZlsjqX7nJLoY8dRv43v2H5YIdQgIhyWU9o8scktnsG8DQnnCK +FN61H9ADRa48S1ylykk1dSXir6LqqnnLlVZxI4CzRH4qmkSz1vYu98cfI4jaF/Zak5E BC5g== X-Gm-Message-State: AOAM530zZI9wOUj1HjLGg31emgZOcCVMxirgVC0pMIpdCyKL/aq4Lrxt PEaogYCkdPdFIVAbU0IWVy9kI8X1KsLS X-Google-Smtp-Source: ABdhPJyikj6QzzefY5xo7SWXSM/OK/736d0/+m3Zo491Wj4wZVDep2Ui8XZDZnWT2k0Mw+7g80lkXRqnCVEx X-Received: from zokeefe3.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1b6]) (user=zokeefe job=sendgmr) by 2002:a17:90b:1e10:b0:1bf:6c78:54a9 with SMTP id pg16-20020a17090b1e1000b001bf6c7854a9mr927835pjb.1.1646775295506; Tue, 08 Mar 2022 13:34:55 -0800 (PST) Date: Tue, 8 Mar 2022 13:34:08 -0800 In-Reply-To: <20220308213417.1407042-1-zokeefe@google.com> Message-Id: <20220308213417.1407042-6-zokeefe@google.com> Mime-Version: 1.0 References: <20220308213417.1407042-1-zokeefe@google.com> X-Mailer: git-send-email 2.35.1.616.g0bdcbb4464-goog Subject: [RFC PATCH 05/14] mm/khugepaged: add mmap_assert_locked() checks to scan_pmd() From: "Zach O'Keefe" <zokeefe@google.com> To: Alex Shi <alex.shi@linux.alibaba.com>, David Hildenbrand <david@redhat.com>, David Rientjes <rientjes@google.com>, Michal Hocko <mhocko@suse.com>, Pasha Tatashin <pasha.tatashin@soleen.com>, SeongJae Park <sj@kernel.org>, Song Liu <songliubraving@fb.com>, Vlastimil Babka <vbabka@suse.cz>, Zi Yan <ziy@nvidia.com>, linux-mm@kvack.org Cc: Andrea Arcangeli <aarcange@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, Axel Rasmussen <axelrasmussen@google.com>, Chris Kennelly <ckennelly@google.com>, Chris Zankel <chris@zankel.net>, Helge Deller <deller@gmx.de>, Hugh Dickins <hughd@google.com>, Ivan Kokshaysky <ink@jurassic.park.msu.ru>, "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, Jens Axboe <axboe@kernel.dk>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Matthew Wilcox <willy@infradead.org>, Matt Turner <mattst88@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>, Miaohe Lin <linmiaohe@huawei.com>, Minchan Kim <minchan@kernel.org>, Patrick Xia <patrickx@google.com>, Pavel Begunkov <asml.silence@gmail.com>, Peter Xu <peterx@redhat.com>, Richard Henderson <rth@twiddle.net>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Yang Shi <shy828301@gmail.com>, "Zach O'Keefe" <zokeefe@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 11483100007 X-Stat-Signature: 8rf7sjza7ch9jnqkbwixx38tawesc1nj Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="J/04UN8x"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 3_8snYgcKCE4F40uuvuw44w1u.s421y3AD-220Bqs0.47w@flex--zokeefe.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3_8snYgcKCE4F40uuvuw44w1u.s421y3AD-220Bqs0.47w@flex--zokeefe.bounces.google.com X-HE-Tag: 1646775296-594436 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
mm: userspace hugepage collapse
|
expand
|
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index b204bc1eefa7..56f2ef7146c7 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1253,6 +1253,7 @@ struct scan_pmd_result { struct page *head; }; +/* Called with mmap_lock held and does not drop it. */ static void scan_pmd(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, @@ -1267,6 +1268,7 @@ static void scan_pmd(struct mm_struct *mm, spinlock_t *ptl; int node = NUMA_NO_NODE; + mmap_assert_locked(mm); VM_BUG_ON(address & ~HPAGE_PMD_MASK); pmd = mm_find_pmd(mm, address);
scan_pmd() requires mmap_lock held in read. Add a lockdep assertion to guard this condition, as scan_pmd() will be called from other contexts later in the series. Signed-off-by: Zach O'Keefe <zokeefe@google.com> --- mm/khugepaged.c | 2 ++ 1 file changed, 2 insertions(+)