Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4813321iob; Mon, 9 May 2022 02:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkEfSpCDMbv0kwoaAAhI1Kj3Lcq0pJouRXEQQqLAy8Akrn2ur5wQnEMPkIaRR8+0X+yFGi X-Received: by 2002:a17:902:cac2:b0:15e:f33e:f7c1 with SMTP id y2-20020a170902cac200b0015ef33ef7c1mr12631965pld.143.1652087387296; Mon, 09 May 2022 02:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652087387; cv=none; d=google.com; s=arc-20160816; b=vdCTjNhON1ZxC4lvobbZWktc8FM50GuV7LbQXUZfbILdz8ILkoQGCmgJ+W+ol22z7e 7C7Qgn//0dtC1xTZeml+B8S2BgxiM98xMFmHnHxXq+FhCdwitU0WVCbDYOqgT76R6xXm AdwMvKN0kQ+253SJY1TSPyPYBHduqEhVHI38LvyoJWeY4lCI2a2tvsGrYzbrh+On89vu yLDr8phPhlJyu+/2wJB+N/7MRxTYNvH20mVXsU6z33STnU1XOZc607AOtlMgFbAgP7UN G2xe1IaN42URz8WkuZBXK0sXlPHZmFdGx3mRL2LzY8tzc7cdON2rrorqA4lAm5GUpcBH iX5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=AWSurWcohhfmbg0HsGn0qKNcAR8FqOCWbzzMOoE2D2M=; b=jneJNBUgMBFfRnrEBkDr29WiWgdL4TLOZyv/OZ1FuFkV+AaaPQHwPAJ9RPr1syPVZ3 wmCexE5mxdj/O1nNod0p2F/OGNQBtkd/c8ub/OSyZ1i/ro66ldMLHRTmRpawno6Op8ll BOIcnjWGTSqyNnFmhj1wlO8rLd0YCF6m/NccA88wVeSm/7xl7f7hH05jOVp/RttnLIDC ho0O6+/oqPxfHts/ZResMl6voEvJoBfn78NRG0iuSaqN10AUtp8i8D0DYyrwPaU/Qhno jbLZ1wdE4lULAytm93DDE+6o05XUze5C8sfvg5gib8Vo9jnSJgOGczmLRrGJnwBH/zLI jTmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=pjNdf+wv; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h186-20020a636cc3000000b003c186ab9092si13018270pgc.538.2022.05.09.02.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:09:47 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=pjNdf+wv; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 440D718C049; Mon, 9 May 2022 01:56:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387512AbiEGVaY (ORCPT + 99 others); Sat, 7 May 2022 17:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235745AbiEGVaU (ORCPT ); Sat, 7 May 2022 17:30:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB9BBC32; Sat, 7 May 2022 14:26:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7273E60F1D; Sat, 7 May 2022 21:26:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8936FC385A6; Sat, 7 May 2022 21:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651958791; bh=TpnUc2DE5KFYkQnmUd4Sv+a4aCiTuBPeApHJNytttBc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pjNdf+wv67dGI3O/VbxZIjKLTI4TigjrucaDTW42JMGnwVsHYqDS8DWIqz2NfVoro WHoPr6hO0dYaQ1qFYxgMcWuCydf7PV5uLp3JKveImP52BsWIAMb5rZtzFotNj0Mt9I gJ1WKCPuoNGe/7DZs+5m8H8FGmaQB4n98c3jdvRo= Date: Sat, 7 May 2022 14:26:30 -0700 From: Andrew Morton To: Joel Savitz Cc: linux-kernel@vger.kernel.org, Shuah Khan , Nico Pache , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Sidhartha Kumar Subject: Re: [PATCH] selftests: clarify common error when running gup_test Message-Id: <20220507142630.56f7ee13658d6fd78cc2d88f@linux-foundation.org> In-Reply-To: <20220502224942.995427-1-jsavitz@redhat.com> References: <20220502224942.995427-1-jsavitz@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, 2 May 2022 18:49:42 -0400 Joel Savitz wrote: > > The gup_test binary will fail showing only the output of perror("open") in > the case that /sys/kernel/debug/gup_test is not found. This will almost > always be due to CONFIG_GUP_TEST not being set, which enables > compilation of a kernel that provides this file. > > Add a short error message to clarify this failure and point the user to > the solution. > > --- a/tools/testing/selftests/vm/gup_test.c > +++ b/tools/testing/selftests/vm/gup_test.c > @@ -18,6 +18,8 @@ > #define FOLL_WRITE 0x01 /* check pte is writable */ > #define FOLL_TOUCH 0x02 /* mark page accessed */ > > +#define GUP_TEST_FILE "/sys/kernel/debug/gup_test" > + > static unsigned long cmd = GUP_FAST_BENCHMARK; > static int gup_fd, repeats = 1; > static unsigned long size = 128 * MB; > @@ -204,9 +206,11 @@ int main(int argc, char **argv) > if (write) > gup.gup_flags |= FOLL_WRITE; > > - gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR); > + gup_fd = open(GUP_TEST_FILE, O_RDWR); > if (gup_fd == -1) { > perror("open"); > + fprintf(stderr, "Unable to open %s: check that CONFIG_GUP_TEST=y\n", > + GUP_TEST_FILE); > exit(1); > } > Sidhartha did a similar thing: https://lkml.kernel.org/r/20220405214809.3351223-1-sidhartha.kumar@oracle.com (Which is now in mm-stable at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm) Although in retroreview, it should have printed that to stderr rather than to stdout.