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 E6D09ECAAD3 for ; Sun, 4 Sep 2022 09:37:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F4768015A; Sun, 4 Sep 2022 05:37:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A52D8D0030; Sun, 4 Sep 2022 05:37:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 472118015A; Sun, 4 Sep 2022 05:37:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 342AC8D0030 for ; Sun, 4 Sep 2022 05:37:01 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0858C4041A for ; Sun, 4 Sep 2022 09:37:01 +0000 (UTC) X-FDA: 79873899042.04.96F4452 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by imf15.hostedemail.com (Postfix) with ESMTP id BA392A005A for ; Sun, 4 Sep 2022 09:37:00 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id w8so9272680lft.12 for ; Sun, 04 Sep 2022 02:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date; bh=3dCz4gBqjzOilHFtYTlf/ApX6Q5+noMG1nnD61cseRw=; b=jJb+uyhjvdbyqic5hW9XkTyprs/ZXewrWaUC2JqIYeIrSDDX72xyF+yE6S6FXKxkYP MAjpcp44tBa1M6V9qDnSdvmruLagKz3dCBxL80Rv1bfNn680xCy2MHQwh/7kfq7Q3O+P kV2geB6Cqix7dKPeQYs+4b4wDWsuk0cEA5VXXUMVYhUJuUJA2s+1Cy3BUagocAHNiR9X deOIq16sNjnIZ7Isx+8HgBwd/XvqPg1nmwowWtKURlWoLReL+VbS0TqgnsL9m8s1MiDo mGbN7ZgRFXJg/bu+jH5gzX6oh8vblXrFSnbzU1fE7EOjKzrLyFc5chZ81Zo0OlcAg+EO GpqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date; bh=3dCz4gBqjzOilHFtYTlf/ApX6Q5+noMG1nnD61cseRw=; b=eqWQlnTfHzd0qkyaMXOqZ8lqa2J/Iorgr/q7YV0uIvtft3sXLwUz3UPAsXrOiWFED3 vB96gRTKys0FuZbEmcyR2wCW2MU7w17ODvFQdH5i4EEYz8oLsr0sne6+DPSCrkO42dEq yaEyPnHNJiQWnplF4G9YLtugjXliYG4tP95ATIEdTAXapz5AuhRXtrtBayenfTXj7nZW rewAhORce1UTxTpHxuw82uhT0qvzFbu94AA1b7SAoZS81+T0Oiz5r9gN1Ldo9LDLvsB4 jJNZ5fzvEpasQSTDrDK0zzs76S5pdCoxp1dHUaMtOkXkrgV3MHZkBoxgQCMifcADBjEO kNQA== X-Gm-Message-State: ACgBeo18cIjPmJy1f//0Jq7Lly4PgzXSusADuF8nI1ff96hdUP1CXuf9 pajndmZly88lH3nilVixzbM= X-Google-Smtp-Source: AA6agR76zNDnW4m4bvvHgjl0eb4Bf4A4SqJtDlpS0YKjnDZYoHmNdIAh/Fg0b3h/AqMVYj58GS8/wg== X-Received: by 2002:a05:6512:acc:b0:494:66a9:4a7f with SMTP id n12-20020a0565120acc00b0049466a94a7fmr11299716lfu.479.1662284218889; Sun, 04 Sep 2022 02:36:58 -0700 (PDT) Received: from pc636 ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id r17-20020ac252b1000000b004946748ad4dsm842891lfm.159.2022.09.04.02.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 02:36:58 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Sun, 4 Sep 2022 11:36:55 +0200 To: Song Liu , Andrew Morton Cc: Uladzislau Rezki , Song Liu , Andrew Morton , Linux-MM , open list , Song Liu Subject: Re: [PATCH] mm/vmalloc: Extend find_vmap_lowest_match_check with extra arguments Message-ID: References: <20220831052734.3423079-1-song@kernel.org> <20220831160111.a6e7d17785ca21ce7c43981c@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jJb+uyhj; spf=pass (imf15.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662284220; a=rsa-sha256; cv=none; b=fzIMxQsUO3E5t0Bb7B3Y81sT5gRVF8LsQzpzp6ozxEzbRbePlK3o56OzKSEHHVFT3x7JoS behVbg1lP7HZu5dOiafKPTfC5cx/c+yh9KcyUZYqoK9AwzntPIVjTCQ+rlDzyU/p0Ft1SX XKrFA5puFMQ/siVTg0pA4uzIkJcCX7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662284220; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3dCz4gBqjzOilHFtYTlf/ApX6Q5+noMG1nnD61cseRw=; b=FJt9bFr4ZMpT0WFRAzQtwVkwy2TIMvdoECce2LzlGNxi7m6mCBWFGxhDraGRWwUdEAxjpf mndi3caqRKIuDjFKfV6LI2+j3OBSJAwfHWGb+3PW0MaJP1AKBBDKxREWr4h+H5N0hazCPk VgcPQnjfbiZ+F59+6vxndo1J5BzO/zk= Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jJb+uyhj; spf=pass (imf15.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-Stat-Signature: 4dogzhuicfu8mjfdcdk6js9m739ezuof X-Rspam-User: X-Rspamd-Queue-Id: BA392A005A X-HE-Tag: 1662284220-639864 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: > On 09/02/22 at 06:45pm, Uladzislau Rezki wrote: > > > > Even without this patch, the debug path would work correctly. The > > > > difference is just only in > > > > whether roots are hardcoded or passed over function paramter. > > > > > > Calling find_vmap_lowest_match() inside find_vmap_lowest_match_check() > > > will fail compilation because the function interface has been changed. > > > > > Ah. That makes sense, though the commit message has to reflect it. > > So it is only about compilation error if debug is ON. > > Indeed, the current patch log sounds like an improvement or normal change. > In fact it's a code fix. > Then i think it is worth to mention about this in the commit message. At least i have missed the main point of this change looking at the commit message. Song Liu, Could you please upload a v2 of it stating exactly what it fixes? urezki@pc638:~/data/raid0/coding/linux-next.git$ git diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e68c0081e861..7552f1f8350e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -713,7 +713,7 @@ EXPORT_SYMBOL(vmalloc_to_pfn); /*** Global kva allocator ***/ #define DEBUG_AUGMENT_PROPAGATE_CHECK 0 -#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 0 +#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 1 static DEFINE_SPINLOCK(vmap_area_lock); urezki@pc638:~/data/raid0/coding/linux-next.git$ make -j64 bzImage DESCEND objtool CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC mm/vmalloc.o mm/vmalloc.c: In function ‘find_vmap_lowest_match_check’: mm/vmalloc.c:1328:32: warning: passing argument 1 of ‘find_vmap_lowest_match’ makes pointer from integer without a cast [-Wint-conversion] 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false); | ^~~~ | | | long unsigned int mm/vmalloc.c:1236:40: note: expected ‘struct rb_root *’ but argument is of type ‘long unsigned int’ 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size, | ~~~~~~~~~~~~~~~~^~~~ mm/vmalloc.c:1328:9: error: too few arguments to function ‘find_vmap_lowest_match’ 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false); | ^~~~~~~~~~~~~~~~~~~~~~ mm/vmalloc.c:1236:1: note: declared here 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size, | ^~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [scripts/Makefile.build:250: mm/vmalloc.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:2003: mm] Error 2 make: *** Waiting for unfinished jobs.... urezki@pc638:~/data/raid0/coding/linux-next.git$ Thank you in advance! -- Uladzislau Rezki