Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2781017rwd; Fri, 2 Jun 2023 14:50:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LaOF5DlinvoGSrscMNtplZ7RD+WA65sA8yt+E7Fq6+1qPFDPsy7lmEfbB3ybfNt60Mfq5 X-Received: by 2002:a05:6808:4d2:b0:398:132b:7462 with SMTP id a18-20020a05680804d200b00398132b7462mr1112508oie.54.1685742617764; Fri, 02 Jun 2023 14:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685742617; cv=none; d=google.com; s=arc-20160816; b=lIIYDXHYfSB0Wi6b/+mp0Q23HggH36R6fTbDI/MjsIODz68YtQjWZu9JYBIBkd4DaV R7gl4Wc6ISWJnq7ptA7hrCXJSvJaMtFpSFF+bGqEFXowGySsPhpr1Da5tnZ3/6BxYhK+ qffkLRQjQO9LVH0uVNiJNQqEJpRVaWrNhg0CSB45QMmxfV6dEcU6dmkRKlxWJ/gLLJgN C/Ne9Ujrh2SSG2w+it22apOvcwJk/Mc2GPPg0mj3LzF+MD0iyCktg3xVmPJ6haKt8O1c XdD9u5n3edbpf6LEZqM9JKyfwRSgP/Afn5ktekbjt9DLyVWg+z7Jqp+vToZKVl/E4Ffp Fcow== 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=TsdZlWSOiNT7hzk1rZDtrEHgINd/xV3z9w3UHd3nqCo=; b=gSawNvugL+VSJ+gbb41eSi/lHEzbUKHukCvPWEUhafy7A2wEVm0gfRhoLpYwwgShq9 CR24hcrjELvlbJMq6c12Xnan2LalVg30wsCvqDktCPUKP/0I2rxjeEcGahNX50GlbDdZ rktkvEpKCN0DK23WFmsCRAXUR947elIoZupAcDQXxEdjDUh+AYXm+WHv7SYkDaQAUPMe /w12R03nf3RPnZG8UN8FoCZnshX53SkVol8m1oSMPYKGM0ogEG/m1vOGDAAMgnpSlZEZ I91bLmOXX3JnosH/R0l4GxvzOe3sBeNwzxZPZab251gMcEcpBLoKJnGgxxdtYkKHdg/n 7xyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ooailrvi; 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 x191-20020a6386c8000000b0053fb7968568si1643430pgd.16.2023.06.02.14.50.05; Fri, 02 Jun 2023 14:50:17 -0700 (PDT) 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=Ooailrvi; 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 S236529AbjFBVhE (ORCPT + 99 others); Fri, 2 Jun 2023 17:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236293AbjFBVhD (ORCPT ); Fri, 2 Jun 2023 17:37:03 -0400 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 C8ECC19B for ; Fri, 2 Jun 2023 14:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685741774; 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=TsdZlWSOiNT7hzk1rZDtrEHgINd/xV3z9w3UHd3nqCo=; b=Ooailrviy5FmEEKL5c5HdLjVw5J2VKEroD+BzfFZizC59BcysmBsUKthwBKJFb0zKJe65C MW/HPMLrzAR1vxifZMwcKbHShXCCe7uXUMpvrMWN+sb28z4GcylZUKCgqrjTY6Lgs8EUdh EyLGH4JHYX64vXWu6nAMQJnpw3QtAB4= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-smD5jUFLOuOagi6v4v0Xvw-1; Fri, 02 Jun 2023 17:36:12 -0400 X-MC-Unique: smD5jUFLOuOagi6v4v0Xvw-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-75b147a2548so34081785a.1 for ; Fri, 02 Jun 2023 14:36:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685741772; x=1688333772; 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=TsdZlWSOiNT7hzk1rZDtrEHgINd/xV3z9w3UHd3nqCo=; b=FfccZwCJ8mCt/7sTak+IiTHWk3QZKhZfPE1hyfDE0z/4FqXD5QX0z49fa9i4zHo7Dy ZL+KHxgt2IDXPEioNL8KWBYIWBcpNw2J6n2RDVEa2ZCV7OTsEok9/eaE/HU4SMNuHAZE OYftfGogeVxEBumzAX3yL7uLaXhY443Aq2B1gEWTJu/S62rp8aNcxl3lGZ6MlTER2fU0 868F+PSdjKwt140jAV2T2LmIq3XB+Rn+R8l9EbJqVS6ZKN1iW0MN7B+y62pszXrOBQTw KUCVig/F4J1yqunphaSy313oCnwRVq4CnwRoQszZ2FrzNrNlxHHLFSdywfHoDKS8Z7BZ mHkw== X-Gm-Message-State: AC+VfDx9nRHxd20vKATZ1xGU8QfW/vMmkTWKkTJdAvGz3od2edTp7kLV DxYJuOuEZhjgstjwlJ3ix/AI3fNBXmndYgoCMGxz6apPXZI1xybQNzIgFYcQ0I4q+i4XRWFXdzc oSI+DHcPz0Su7vk7TyLYvijkG X-Received: by 2002:a05:620a:6608:b0:75b:23a1:69ea with SMTP id qf8-20020a05620a660800b0075b23a169eamr10523157qkn.1.1685741772205; Fri, 02 Jun 2023 14:36:12 -0700 (PDT) X-Received: by 2002:a05:620a:6608:b0:75b:23a1:69ea with SMTP id qf8-20020a05620a660800b0075b23a169eamr10523143qkn.1.1685741771939; Fri, 02 Jun 2023 14:36:11 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id c1-20020ae9e201000000b0075cd3d61715sm1079251qkc.47.2023.06.02.14.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 14:36:11 -0700 (PDT) Date: Fri, 2 Jun 2023 17:36:09 -0400 From: Peter Xu To: John Hubbard Cc: Andrew Morton , David Hildenbrand , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Subject: Re: [PATCH 05/12] selftests/mm: fix invocation of tests that are run via shell scripts Message-ID: References: <20230602013358.900637-1-jhubbard@nvidia.com> <20230602013358.900637-6-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 02, 2023 at 12:19:17PM -0700, John Hubbard wrote: > On 6/2/23 08:34, Peter Xu wrote: > > On Thu, Jun 01, 2023 at 06:33:51PM -0700, John Hubbard wrote: > > > We cannot depend upon git to reliably retain the executable bit on shell > > > scripts, or so I was told several years ago while working on this same > > > run_vmtests.sh script. And sure enough, things such as test_hmm.sh are > > > lately failing to run, due to lacking execute permissions. > > > > > > A nice clean way to fix this would have been to use TEST_PROGS instead > > > of TEST_FILES for the .sh scripts here. That tells the selftest > > > framework to run these (and emit a warning if the files are not > > > executable, but still run them anyway). > > > > > > Unfortunately, run_vmtests.sh has its own run_test() routine, which does > > > *not* do the right thing for shell scripts. > > > > > > Fix this by explicitly adding "bash" to each of the shell script > > > invocations. Leave fixing the overall approach to another day. > > > > Is it possible someone just doesn't have "bash" at all? I used to only use > > Well, maybe [1]. But that someone won't be running these tests as-is, because > the tests explicitly require bash, even before this patch. > > > "sh" without bash installed I think, but that was not on Linux, so I'm not > > sure how much that applies.. > > sh invocations are for when you want to express that this script should > avoid using bash-specific things, in order to ensure portability to > other environments. > > But here, the run_vmtests.sh file requires bash already, as per the > first line: > > #!/bin/bash > > ...which is ultimately why I decided to use bash, rather than sh here. That one can be easily override with $XXX run_vmtests.sh, hard-coded "bash" in Makefiles can't, afaiu. > > > > > Maybe use $(SHELL)? I saw a bunch of usage in the tree too. > > > > That's more of a Makefile construct that you are seeing, and only in a > few odd Makefiles. Recall that in Make, $(SHELL) has the same effect > that ${SHELL} has in bash/sh, by the way: dereferencing a variable. > > And Make's "$(shell ...)" command is what is normally used to *run* a > shell command, in the kernel's build system. > > Having said all that, I will take a quick look at what it would take > to shift over to the selftest framework's run_test() instead, in > order to avoid this ugly "fix". Just to mention that I was not talking about $(shell ...), but the environment var $(SHELL), or "env | grep SHELL". Please feel free to have a look at tools/perf/arch/x86/Makefile. Thanks, -- Peter Xu