From patchwork Mon Oct 24 18:08:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 10125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp633582wru; Mon, 24 Oct 2022 13:14:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DhLk+z09k69DYm3iWlby4LbyZmyLSPQCenjpAFVrD05vnS0ZLOBjw0tVSoLWnmhCoZ1U+ X-Received: by 2002:a17:907:628a:b0:781:bbff:1d42 with SMTP id nd10-20020a170907628a00b00781bbff1d42mr28704606ejc.375.1666642486102; Mon, 24 Oct 2022 13:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666642486; cv=none; d=google.com; s=arc-20160816; b=yATzaAu8S4sAxNFPb+JDcoR1fUR7NSWKd0UPDuLTBEtm6pPxS0xq8XZDle1Z64a4nG 7+f/QX1p5xBwQBJP67+D+MJPGpMHSpqHZ+rRYH0sqCo3XRKbAW0Va/6NvkDVj+bhyQWx auOG+xtQFcGsltgQ+QQ3ucM1o7h9IG6crig3/At1UWVt/m+I8w7CEU/C1fx8zCXY7qju /sw/Nq8xLeetoNzA9PLvMxo5pQuDNh8QzMWSzGFc/6Un90OYbM6BmJLJLOPTZZGW6lPU TT2nNVPo2WdwbV7hhuqvj1XlniZ7TQrYum/ifJF6xMMSUvrQoSIL8eEjS4OoSispJeYt 22xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=iRzKfRmrblnsyJdGRiUYKhbp/UZezO6TzRKVJ+GWMvgySmvewV85h9elOdGRr62LHy T0psxfhOT7uGdxIHgJgTxXQoh5cO4BA4OuB9t4QGrmixf+96KJj7MwKNOVeEern/moBK pYthMBuzAE9CTgAYfFTHwLYFP+GGS3aQ3TqBS16KbjT1BKwUnemZguI/WaUCK3Y682nZ srJyrkhz3PZvEcWT6ssY0nCFZr3nae9ChxM+fMZaxJIz6+E7381+6Pm2nPkvu4l2iH8p heEVPTxalVsFB2wW6KKl6Vyz3DX+L31LyU5x3BwAsWQhAt4qv9f1XgtseH7/wxYCJwoT KxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bGBaY2g3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di10-20020a170906730a00b0078db3556bddsi580889ejc.804.2022.10.24.13.14.22; Mon, 24 Oct 2022 13:14:46 -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=@gmail.com header.s=20210112 header.b=bGBaY2g3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbiJXUCS (ORCPT + 99 others); Mon, 24 Oct 2022 16:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232257AbiJXUBS (ORCPT ); Mon, 24 Oct 2022 16:01:18 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B772324E410 for ; Mon, 24 Oct 2022 11:22:51 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id bs21so1613822wrb.4 for ; Mon, 24 Oct 2022 11:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=bGBaY2g3DIx/8hN0JHcD0TSN7Cpg0DthUSR9UhTbI2bCgNeTHiMw6mcP0Y+qmezrXx oVhpnBDu7LPbNPgQDkEoau1+okRNRNBSvdRInQrBleUZ/rlVAEBAxMeuwIMsA2WiyooH c+jwwWtZTdq/Z6kh2GP5lPoNiRku3hx1+gkKo5vkQgUSwhtzNIwCq3fRecW3BvfG4v3V ui5JcfOo0f3c9au75ma9f2rZqthRhTqUaVI8ca6ODWd0sMgYbvsJ2wej/aaf0oxQSOgs BYJDEIqoUcI/e3t4dgxdCC9Yumymc2Dw7VHTaqMEfn/13Axv/+dHEWogGDaV0MN/nbwd +Jdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4cTRya7BWPcqsR7OtszqL7KchFavr9g3TQZiRi/8988=; b=N9K+Dx4EqS9RV2HeH+p4cUtC863I60ElFZR927UMJQvo3p+h8S+PVRFLDWEzaizona FgkHJHw1v2ew4abnXsdZ0APqj4mlmxJh95k4fpra4/7cilHPLf6KmT1GR0HU2Im+8DJa hIPmdsj74sOtHDf8NbBlPr8XbuFV7DvrrMzmgtvfISxzw47IFiv3Naaq1IOPxN6KLwhW nUF2oI8vxTzJZOD+to1fIm8rJbIALvbzj5QDN1y1CIH1C1Sq296GVtzWk0fttM3/I5iR TfIFfuhaHv30cpwG+QTl9wl59MTEcFi/qk+JKhldEk0TAt3gG8jgBbpE9PYSyAXPrZ1d 6vyQ== X-Gm-Message-State: ACrzQf2fS4CWAiJtjyladljxTE45Kgcg1/pOFW8O6THPos3qxVvkXVrI iX0QLgrd4UFXm5BHcnp64VnwbLhiMA== X-Received: by 2002:adf:f4ce:0:b0:236:6578:48b2 with SMTP id h14-20020adff4ce000000b00236657848b2mr7343482wrp.181.1666634891401; Mon, 24 Oct 2022 11:08:11 -0700 (PDT) Received: from p183 ([46.53.250.110]) by smtp.gmail.com with ESMTPSA id h6-20020adfa4c6000000b002206203ed3dsm330262wrb.29.2022.10.24.11.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 11:08:10 -0700 (PDT) Date: Mon, 24 Oct 2022 21:08:09 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] proc: fixup uptime test Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747601311338750257?= X-GMAIL-MSGID: =?utf-8?q?1747601311338750257?= syscall(3) returns -1 and sets errno on error, unlike "syscall" instruction. Systems which have <= 32/64 CPUs are unaffected. Test won't bounce to all CPUs before completing if there are more of them. Fixes: 1f5bd0547654 ("proc: selftests: test /proc/uptime") Signed-off-by: Alexey Dobriyan --- tools/testing/selftests/proc/proc-uptime-002.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/proc/proc-uptime-002.c +++ b/tools/testing/selftests/proc/proc-uptime-002.c @@ -17,6 +17,7 @@ // while shifting across CPUs. #undef NDEBUG #include +#include #include #include #include @@ -54,7 +55,7 @@ int main(void) len += sizeof(unsigned long); free(m); m = malloc(len); - } while (sys_sched_getaffinity(0, len, m) == -EINVAL); + } while (sys_sched_getaffinity(0, len, m) == -1 && errno == EINVAL); fd = open("/proc/uptime", O_RDONLY); assert(fd >= 0);