Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3588955rdb; Wed, 13 Sep 2023 17:36:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/j/dtFNAuX15BETApkYNzIIwBoeO4co5HkSUZxKQoyna+7sZnF57Dx1xERIhyhg+/mnaS X-Received: by 2002:a05:6a20:244a:b0:154:a9bc:12ca with SMTP id t10-20020a056a20244a00b00154a9bc12camr4372530pzc.26.1694651778588; Wed, 13 Sep 2023 17:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694651778; cv=none; d=google.com; s=arc-20160816; b=Q3MNtF8It1XFOaUcRArQt3yiaC8hHfx0GXci2UsbZ0lVDG+IakbteCPGDURULmXLiQ yufwsRrWbE8/M5YDXSLq0bybhBbtmdCrSInf4QWzbVuiNoTMLBIVtJTpNvp+zMkAhMya 7hOQ+6YmfKpOJ0XQVE5doCfFSm7RbJyKJKFSk3WVyszTomZWOLScc46hWYQ+Nf8RIRNC nx+XgcuEKvmMdK3QerZV4d/LDSO6Gi9sey73qOsIhyuUUEDDqMpav+0y8pByRZzicy0b fmXpeYlwEZczd3w5WO04tITo7E3lOL/yMX0myqsfd932AdHDDK5iPDSm8h+4E9PqENkM FM8A== 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:date:from:dkim-signature; bh=GFpe8x5qo/g5j4s2/ldCOIs5ClZpZwe3ie5guHHQEOQ=; fh=xWNw8M+dFlHf6Lsb0Jaz42XDaNVPzQ6lS9srbS1M5gI=; b=WunuV9iHEv9D4HG8+aGI9se/oVVtFJF1YwMM6n/ZWiLVNeIu8nHqKZpen6DrhtcsDF wrVzyMllr0lBdPS1kKT9G85aEntS56w2RSiVAMwWgI7ew3/yPqTZEyU9sEqamu5QOn4d efMNWT9SFL6goY8CDvOd80FzYJZK/57p/gUwtZUupVXlyrBSk+6klioZY1zBLUPWsQwV CyGy71s78Meka9RsqI2pnprpdas9DRDKUh7klxDvRrjEzTZ+I1KFJQZyK+OtCN1CPsoY +RYXBYMSZlRpHkq7Sg8OOlwzBkhKKJyl4w0t1Tp+v3HaVO9EUeynRYhSl/BgCUx2eAW4 4/wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=SzVNOQtm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cd18-20020a056a00421200b0068e35157c11si390428pfb.112.2023.09.13.17.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 17:36:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=SzVNOQtm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6C1C88186507; Wed, 13 Sep 2023 08:39:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229655AbjIMPi5 (ORCPT + 99 others); Wed, 13 Sep 2023 11:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjIMPi5 (ORCPT ); Wed, 13 Sep 2023 11:38:57 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A22B93 for ; Wed, 13 Sep 2023 08:38:53 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bcb89b476bso120260271fa.1 for ; Wed, 13 Sep 2023 08:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694619531; x=1695224331; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=GFpe8x5qo/g5j4s2/ldCOIs5ClZpZwe3ie5guHHQEOQ=; b=SzVNOQtmcR3QlIoPx8L6Acz0EiroH7jYnSnid84ZiG0Cio8bFMumZcoCFDgqHeHEU2 XKkX0j20MIuuOAWXNZJFEqwssA0yB7RB+APocnOUpDNtKoogsSy3qh6IfIVVRDj4RBoS XfrQZDT1MT8t57Wh7rEhJQJn48f32w0+Al9q0IXv84LfjNUBS/fULsaq5jERn9lt9rao B0KI/jZdqtxlsl1T5a8Du2+rUSR/nuudIPPS+Edkb/t+TokjBX3rJ9MLaVGSZrNDc49V fVLLH2wPF+TeCrzy4IC7Dlizj00dYZ0mGWxXgVoWD2AGg3BDczc/ALbd2S+mNvLJVlRr HsDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694619531; x=1695224331; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GFpe8x5qo/g5j4s2/ldCOIs5ClZpZwe3ie5guHHQEOQ=; b=fLr17Brv+ZiYXMvaTjvf+iQpLSrEZkABzXIWMGcjTqeV6i30ME2fj3Rf8bbuAS+sRh Uw7VK0nV16hw+Usv0F2FZ8BDf2qHltvv1tHeqJM88xpzfQtm5X+MwZFncGfrw1jPgJ2T CIKk+D5MW9Aj719gexLTVySPPTyesbPt0/CucylbUTNnARysYLxFnrr4Dw0vX3yjPnxw xNAqi28BbO5GNLYBR1c5rCY8AOBHGLvedzFsxD+ol0nIXV4pNYxylxzX8qysfXgtP+f+ Wiz6VE2SEry1TjQOk+PY9Nuy1yQbpsx5qf3xN6bRcxfeCNQc0FhhBtcwfF6Wk/9AKrN7 6w6g== X-Gm-Message-State: AOJu0YzAp+lvFL3pcuneaTkelQQXWuxilOE47EDzIWMKV5mxyrBqOpau BeqFGwMkWW5RVDJ5sbtLj34= X-Received: by 2002:ac2:51bc:0:b0:4ff:a8c6:d1aa with SMTP id f28-20020ac251bc000000b004ffa8c6d1aamr2107222lfk.48.1694619530936; Wed, 13 Sep 2023 08:38:50 -0700 (PDT) Received: from pc636 (host-90-235-20-237.mobileonline.telia.com. [90.235.20.237]) by smtp.gmail.com with ESMTPSA id x13-20020ac25dcd000000b004fbddb14020sm2182107lfq.56.2023.09.13.08.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 08:38:50 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 13 Sep 2023 17:38:48 +0200 To: Baoquan He Cc: Uladzislau Rezki , linux-mm@kvack.org, Andrew Morton , LKML , Lorenzo Stoakes , Christoph Hellwig , Matthew Wilcox , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH v2 7/9] mm: vmalloc: Support multiple nodes in vread_iter Message-ID: References: <20230829081142.3619-1-urezki@gmail.com> <20230829081142.3619-8-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:39:02 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Wed, Sep 13, 2023 at 06:59:42PM +0800, Baoquan He wrote: > On 09/11/23 at 08:16pm, Uladzislau Rezki wrote: > > On Mon, Sep 11, 2023 at 11:58:13AM +0800, Baoquan He wrote: > > > On 08/29/23 at 10:11am, Uladzislau Rezki (Sony) wrote: > > > > Extend the vread_iter() to be able to perform a sequential > > > > reading of VAs which are spread among multiple nodes. So a > > > > data read over the /dev/kmem correctly reflects a vmalloc > > > > memory layout. > > > > > > > > Signed-off-by: Uladzislau Rezki (Sony) > > > > --- > > > > mm/vmalloc.c | 67 +++++++++++++++++++++++++++++++++++++++++----------- > > > > 1 file changed, 53 insertions(+), 14 deletions(-) > > > > > > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > > > index 4fd4915c532d..968144c16237 100644 > > > > --- a/mm/vmalloc.c > > > > +++ b/mm/vmalloc.c > > > ...... > > > > @@ -4057,19 +4093,15 @@ long vread_iter(struct iov_iter *iter, const char *addr, size_t count) > > > > > > > > remains = count; > > > > > > > > - /* Hooked to node_0 so far. */ > > > > - vn = addr_to_node(0); > > > > - spin_lock(&vn->busy.lock); > > > > > > This could change the vread behaviour a little bit. Before, once we take > > > vmap_area_lock, the vread will read out the content of snapshot at the > > > moment. Now, reading out in one node's tree won't disrupt other nodes' > > > tree accessing. Not sure if this matters when people need access > > > /proc/kcore, e.g dynamic debugging. > > > > > With one big tree you anyway drop the lock after one cycle of reading. > > As far as i see, kcore.c's read granularity is a PAGE_SIZE. > > You are right, kcore.c's reading granularity is truly PAGE_SIZE. > I don't know procfs well, still need to study the code. Then it doesn't > matter much with the multiple nodes in vread_iter(). Sorry for the noise. > > static ssize_t read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter) > { > ...... > start = kc_offset_to_vaddr(*fpos - data_offset); > if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen) > tsz = buflen; > > m = NULL; > while (buflen) { > } > ... > } > Good. Then we are on the same page :) Thank you! -- Uladzislau Rezki