Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp237311rwb; Fri, 18 Nov 2022 00:16:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zbeuwG0DGh1oasb/ydaTx2LfACmIlMEq9lncAxOvdA2DUFFKPlTALfz4XYbsBC1VQBD+8 X-Received: by 2002:a17:90a:5317:b0:213:34f7:fb14 with SMTP id x23-20020a17090a531700b0021334f7fb14mr12305487pjh.25.1668759373841; Fri, 18 Nov 2022 00:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668759373; cv=none; d=google.com; s=arc-20160816; b=ogd7aAGjJRIVkD0Wi7ntvB8KQNqXmmERk2w2tBUTq8ur0gBrX3Md9Z0SCmNTCmBW/+ qcVTw2Sr4cbcsXYW9Yud4FjNE+beyhClVdjt+CISYXNCDy+lJ7E9k84/WaK3lQirZNMu Efd+Y4FAtH1cjXzIacGN1wCTYfJHQJwaLpOo1vMTTUYx59qsFeUyLJK0dqftVUdFMxYq PtJmIrCUqE/Wa62vwuXMqCRcKvBGPNaJpRzMOBK89eLjk9XXmj846tyrTilWnEo/670n X9hHaJ+UUXrNw/Dsg1JTMclS8lzRtm5XV12lM+o5wq5zznZlYjD+52+kP4MmBjK/Yead 1hqQ== 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=KQNE2xd9tPn0Zb+jKbifQFfOM1ctrKpJPYI8m278BgE=; b=aFh0mv4Jy9lKQE70IWqFN4Pu0BoyoJZxCaFoImnvcY6kSqdmx25okonnHAshzB+dZD YA6Bw0rS/kqaOpJCtkviuB3Res2de5yujc0cco8mLPkJzN8ORYdnGK1a1Sa+cOmyUUkS wTvsXuDF6yN7SYUsu4nz3Wrx9DfukfDpcYtnblQMeMiMze2oQ3Uvu7qIZXNWoLVXWq68 oUyzqHRQkF4Mf/d5QK10igjjKM7iR/Bh8fQGpBdMxMsXe1ddKHng3XCkD3e2WmTV4zvH r6naWulT+iDL+8IAsQleTv5QjVnhysg4a2rOQWTSYuOsntoB52211C9tVEubfVdfWQVE Xhow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=STi4dfBw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b004770764db90si2984336pgq.698.2022.11.18.00.16.02; Fri, 18 Nov 2022 00:16:13 -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=@infradead.org header.s=casper.20170209 header.b=STi4dfBw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241271AbiKRIBw (ORCPT + 90 others); Fri, 18 Nov 2022 03:01:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiKRIBu (ORCPT ); Fri, 18 Nov 2022 03:01:50 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD686A1AC for ; Fri, 18 Nov 2022 00:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KQNE2xd9tPn0Zb+jKbifQFfOM1ctrKpJPYI8m278BgE=; b=STi4dfBwrwhIaA6LQJCigXd/CS QJd+ZKlBmAivBILmPYix3Bojwl11I7oysAfqyycSgTjfUBzj5uvir5xD0lpGJuJk/eU7UJK0y0j8g /bs9y8EFW8cHZLWbR8lBRBgaPwv3MrU65OYE+NzKodQt31mzucr8gtXATlRFynUBWAUeyUmaUtVLB fw6SW67c2V3NERVa/mtEFfx5w5cV1fhorDMo6IZYHr6scYXnaeeP2pByG03vbTn3EMcPjeIIeLovj jleiqGne2VVPnKAhBAsbSPqCbVPPg261JoPjMP5FWwYN7YQ+vrje9JG3sFvDLs0cnyP0Xbbxu3xG1 BN6hz7qw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovwJq-0024WM-Tv; Fri, 18 Nov 2022 08:01:50 +0000 Date: Fri, 18 Nov 2022 08:01:50 +0000 From: Matthew Wilcox To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, stephen.s.brennan@oracle.com, urezki@gmail.com, hch@infradead.org Subject: Re: [PATCH RFC 3/3] mm/vmalloc.c: allow vread() to read out vm_map_ram areas Message-ID: References: <20221109033535.269229-1-bhe@redhat.com> <20221109033535.269229-4-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221109033535.269229-4-bhe@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Wed, Nov 09, 2022 at 11:35:34AM +0800, Baoquan He wrote: > Currently, vread() can read out vmalloc areas which is associated with > a vm_struct. While this doesn't work for areas created by vm_map_ram() > interface because it doesn't allocate a vm_struct. Then in vread(), > these areas will be skipped. > > Here, add a new function vb_vread() to read out areas managed by > vmap_block specifically. Then recognize vm_map_ram areas via vmap->flags > and handle them respectively. i don't understand how this deals with the original problem identified, that the vread() can race with an unmap.