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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C53E3C4332F for ; Thu, 10 Nov 2022 21:07:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E7996B0071; Thu, 10 Nov 2022 16:07:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 397868E0001; Thu, 10 Nov 2022 16:07:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25F136B0074; Thu, 10 Nov 2022 16:07:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 165856B0071 for ; Thu, 10 Nov 2022 16:07:23 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E5910A07F1 for ; Thu, 10 Nov 2022 21:07:22 +0000 (UTC) X-FDA: 80118768324.17.7275899 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 9C79040006 for ; Thu, 10 Nov 2022 21:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668114439; 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: in-reply-to:in-reply-to:references:references; bh=wEIJGZANE1T8izU7X7oDY3JcOnGtojmHOdUtf96UKvA=; b=edk7AWc6PSM4VSwDsLf+68GKeawEDsqQlb4ZUB4eKSr2TzNfItABMiPBX/x+8g4pnb27gp N94IT/kS4t6nYiDiW7jjCKCDoNss08hkK2cNNl7d10/LVGI9eMK2GP0k4w1Xo4BcXNBVKi TvFKFFKA1i+t/88BNH8DXlQml0Qr2DI= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-101-YFNp5v20NdqZOH4zDnBVqQ-1; Thu, 10 Nov 2022 16:07:16 -0500 X-MC-Unique: YFNp5v20NdqZOH4zDnBVqQ-1 Received: by mail-qk1-f199.google.com with SMTP id bs7-20020a05620a470700b006fac7447b1cso3133034qkb.17 for ; Thu, 10 Nov 2022 13:07:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wEIJGZANE1T8izU7X7oDY3JcOnGtojmHOdUtf96UKvA=; b=YAY4HqOHdyaJNlsoQh0vC+yZTcTfsW2G0ObAP/PTAnQ+TnhCxmxur2C7cSEBXxelV3 yKGOjNR3x5aITYaU+qO/RzWd59Gj4q3KuUtWHiBSU5S7wGl20dJH4qjEN/Ww1YTG3mhp zm+4Aq0i0Fl6gao0LEdCbFknM2JJGxzF/olypxOziY5m6eYhui93/0J/peNCObsMgm6j tx1zmp40DpklBBVjch9ACvhbFxTybHK6a0XGLrqWE+p+AYB1S991uBhVE3oiu+MI8C27 q+hcH8Qed6BxfA4GCyKH3EDmi1P5ZW19rAlHr3Z2JZt/6F9E14CC1Jl2/g1Pv3Dpr4st I0mA== X-Gm-Message-State: ACrzQf2Y/r2xJJVtK4OH8cGURZb0jZUojJhl1n8nkeB7XtzsiosjU7Ae DAcOXXyyw9scUmID0+diFTZ4+LhAcoYGE5s/81j/zkedzh578g9EHHc/0tpntIQdDgLpvwWTtoQ mxX/naZz2U8w= X-Received: by 2002:ac8:5245:0:b0:35c:ba3b:8a0c with SMTP id y5-20020ac85245000000b0035cba3b8a0cmr1859632qtn.138.1668114436248; Thu, 10 Nov 2022 13:07:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM6M4K3jw0WUcNK171zqSpFP6TK1Xa1jrFSqY5iW0uY88NWreMMO+nhyti4GfcfuEp9h9wCqQA== X-Received: by 2002:ac8:5245:0:b0:35c:ba3b:8a0c with SMTP id y5-20020ac85245000000b0035cba3b8a0cmr1859602qtn.138.1668114436014; Thu, 10 Nov 2022 13:07:16 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id ff5-20020a05622a4d8500b0039cc47752casm166672qtb.77.2022.11.10.13.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 13:07:15 -0800 (PST) Date: Thu, 10 Nov 2022 16:07:14 -0500 From: Peter Xu To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Naoya Horiguchi , David Hildenbrand , Axel Rasmussen , Mina Almasry , Nadav Amit , Rik van Riel , Vlastimil Babka , Matthew Wilcox , Andrew Morton , Wei Chen , stable@vger.kernel.org Subject: Re: [PATCH v8 1/2] hugetlb: don't delete vma_lock in hugetlb MADV_DONTNEED processing Message-ID: References: <20221108011910.350887-1-mike.kravetz@oracle.com> <20221108011910.350887-2-mike.kravetz@oracle.com> MIME-Version: 1.0 In-Reply-To: <20221108011910.350887-2-mike.kravetz@oracle.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=edk7AWc6; spf=pass (imf01.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668114440; a=rsa-sha256; cv=none; b=KR98UDlzXHdGTcILWiQSwZDwb3Coh4h5f+/Y3WZTypVOVLrg7cfJtS5TO54YcgnEW0gx0R S+cccTMmIRFuWofy11/P+qcxtGOU2e3gSB+3IFEHySSnOoH7h18JbQqr3+zyaz3V5LToa7 NfC9XL1LrgW2Ysle/OvB2mmQ5ONM1P8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668114440; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wEIJGZANE1T8izU7X7oDY3JcOnGtojmHOdUtf96UKvA=; b=xm8RAAbGbtdlm2lH8Oce6h2bw4CHXOFoXeabJud3z4qDbgk+s1doWHUD4lDSaxBxsk5Yh6 3B1h0I1kKCkgZB4IclJqrrHpGEPyTzgxOl2vZ7IVkE/7oY8pkClGd44V1MfZVSTk8bXa72 3ErNVXgcubIlFneUoBFtjSRgQd2m7jo= X-Rspam-User: Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=edk7AWc6; spf=pass (imf01.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: xw9efb7mmty3jod6jghdckki5qhxpwe3 X-Rspamd-Queue-Id: 9C79040006 X-Rspamd-Server: rspam09 X-HE-Tag: 1668114440-287139 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: Maybe it'll also be good if we split this into a few smaller ones? For example: On Mon, Nov 07, 2022 at 05:19:09PM -0800, Mike Kravetz wrote: > Address issue by: > - Add a new zap flag ZAP_FLAG_UNMAP to indicate an unmap call from > unmap_vmas(). This is used to indicate the 'final' unmapping of a vma. > When called via MADV_DONTNEED, this flag is not set and the vm_lock is > not deleted. One patch to fix the real thing (patch 2). > - mmu notification is removed from __unmap_hugepage_range to avoid > duplication, and notification is added to the other calling routine > (unmap_hugepage_range). One patch to fix the mmu notifier (patch 1). > - notification range in zap_page_range_single is updated to take into > account the possibility of hugetlb pmd sharing. Part of patch 2. > - zap_page_range_single renamed to __zap_page_range_single to be used > internally within mm/memory.c > - zap_vma_range() interface created to zap a range within a single vma. Another patch 3 for the two. > - madvise_dontneed_single_vma is updated to call zap_vma_range instead of > zap_page_range as it only operates on a range within a single vma Part of patch 2. Then patch 1 & 2 will need to copy stable, 3 won't need to. Patch 2 in this series will be patch 4. Not sure whether that looks cleaner. Mike, sorry again if this is too late as comment, feel free to go with either way you think proper. Thanks, -- Peter Xu