Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1523067rwb; Thu, 15 Dec 2022 11:05:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tETsmVeM1Jv3gp3x/DpBmoY4sz2Rd9VvDFccVem5jjU7OsYNaTgE2oeIw9W5g4FKyzX42 X-Received: by 2002:a17:907:2e01:b0:7c1:4785:d650 with SMTP id ig1-20020a1709072e0100b007c14785d650mr20041515ejc.26.1671131136475; Thu, 15 Dec 2022 11:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671131136; cv=none; d=google.com; s=arc-20160816; b=06z5Djba0gHZVbnCCOVFt87ge2XrDTzj/4UoT3dfLRRqskzEYuWBFHw7lfcxirchvn koNydRVTBrZeypdiKr3sfldgtvDgb1g/Bzgl/SK2L1azE+ZH9+i+mcd4tFtghCtf8G3d i0//Qmq6ZyE/iCIG34a8Mia1hQpEFrqKaygL86Q7UNCD6edGGA8vMRPUJSmU7FQbb3/G hkaGuCfREgSyTgtIJZG4KSul90kfI6AyPyjEq3IN8kUKrGddFgxOpC1i7YIhaj1GAFug jlDmD80U3irUS2rOLDqZKwse/l/FuQpA3JkYOeB75MzXp8P3o8O10prHpKb1CqBLQ87K Zg7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ekrkd7E3uwhnNPjjtuTEk8Mcw5LuenuIHKpumevKNX4=; b=TE6KBED7SrsPbNzI495SjJocI7ypEBHHBY7JqxvTqTlgdt70MFt20LJz0JJ2GTqVBr CnytW09KEyE7KllxKqCo/FGkw61eidlZb8aCtBTycrf+wKhColzvQyitSolFPlQyn19A M+52Ca6jGIxUb0iAbIL8ZRKf3VFhJlNU7581T7uC5yurtwgjXsdzgeiiLHAPmoos5HrZ tu079KQjcN3WR3atOuZ5spx2JFZKsx7JiJ9515FFCNvEn3ThgSfC6MRB1T7tT1Rf7ry7 IXnS2ONCxxiLVDYH6VPNpLc4Krxoq/zgteyDJ4Md7Y4r+Ju5MZm9Y0NNeienS2D8zHr5 gZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SS72Uoo+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne37-20020a1709077ba500b007c167cdc18esi11752841ejc.747.2022.12.15.11.05.20; Thu, 15 Dec 2022 11:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SS72Uoo+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbiLOSqX (ORCPT + 68 others); Thu, 15 Dec 2022 13:46:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbiLOSqF (ORCPT ); Thu, 15 Dec 2022 13:46:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A062A42E for ; Thu, 15 Dec 2022 10:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671129918; 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=ekrkd7E3uwhnNPjjtuTEk8Mcw5LuenuIHKpumevKNX4=; b=SS72Uoo+3NhieNM4subV77cR1RoBhZ3uUKWN1AoddRAZZq/u0fN+/SatQMaGSWCMt+jwoU E3zw/OQcUDSKNVURxYIMAPquvGqViP15ECs4FHzgSUTSXXbiFtUmls9Ai80q4KoPfjXz4x xFl4EaHyo0xQzfZk5ncxMT0+u77rDjo= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-36-LKb0T-QqMUaRTRRNlvF-_Q-1; Thu, 15 Dec 2022 13:45:13 -0500 X-MC-Unique: LKb0T-QqMUaRTRRNlvF-_Q-1 Received: by mail-qk1-f198.google.com with SMTP id az39-20020a05620a172700b006ff85c3b19eso6534791qkb.18 for ; Thu, 15 Dec 2022 10:45:11 -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=ekrkd7E3uwhnNPjjtuTEk8Mcw5LuenuIHKpumevKNX4=; b=KwG3oFuHgv3jxWPFwXkc9uc0HcEDM871Kv6ChHe6wSw2MjgmLHHoXsZc+jNFXawiyH btRUmz4hmO1VaCtRnSMml15uptERM6Ei0jitofdX3O+ozsfdNre64bANAsdMQRphWrM0 O4DILIIF32NvsX6wdanMxlz2t/Xj7lFGxwVlqZDGpPfUFBYIIWRXpbhGfeEoHdgL8rvH h1iS5ASldCNJhoYXTu9aIcI4Xf/cwQc9r+B381k8uZ7sUNh8A+KzmIGpJUzJKtNotpDJ BAKYNMqs3MMuovhJFaiGQGskvabW+b9GWylhXYvfld6qrU7gFzQHI991wL3HSAGDCqu4 k7sw== X-Gm-Message-State: ANoB5pldRfK9Ir1OQA78Dc7Ez4etYN0K7ekS8y6V05UGrlwy8kH71sVj YgwxUBxDQ2u4sq+7ZEcqgd3yX9lvBe95lHz6JaR9NQKP3/izCTomHnhwR+G2/fauj84hfhynhut jJPN4SE7aVqfUSie+Y0bONz80 X-Received: by 2002:a05:622a:4c86:b0:3a8:1bae:4cc with SMTP id ez6-20020a05622a4c8600b003a81bae04ccmr22930663qtb.55.1671129910994; Thu, 15 Dec 2022 10:45:10 -0800 (PST) X-Received: by 2002:a05:622a:4c86:b0:3a8:1bae:4cc with SMTP id ez6-20020a05622a4c8600b003a81bae04ccmr22930630qtb.55.1671129910726; Thu, 15 Dec 2022 10:45:10 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-45-70-31-26-132.dsl.bell.ca. [70.31.26.132]) by smtp.gmail.com with ESMTPSA id i22-20020a05620a075600b006bb82221013sm12295147qki.0.2022.12.15.10.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 10:45:10 -0800 (PST) Date: Thu, 15 Dec 2022 13:45:08 -0500 From: Peter Xu To: James Houghton Cc: Mike Kravetz , Muchun Song , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Zach O'Keefe , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 24/47] hugetlb: update page_vma_mapped to do high-granularity walks Message-ID: References: <20221021163703.3218176-1-jthoughton@google.com> <20221021163703.3218176-25-jthoughton@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, James, On Thu, Dec 15, 2022 at 12:49:18PM -0500, James Houghton wrote: > > @@ -166,19 +167,57 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) [...] > I realize that I can't do this -- we're already holding the > i_mmap_rwsem, and we have to take the VMA lock first. It seems like > we're always holding it for writing in this case, so if I make > hugetlb_collapse taking the i_mmap_rwsem for reading, this will be > safe. > > Peter, you looked at this recently [1] -- do you know if we're always > holding i_mmap_rwsem *for writing* here? > > [1] https://lore.kernel.org/linux-mm/20221209170100.973970-10-peterx@redhat.com/ I think so, an analysis is in previous v2 in one of my reply to John: https://lore.kernel.org/all/Y5JjTPTxCWSklCan@x1n/ No hurt to double check, though. -- Peter Xu