Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3692090rdg; Wed, 18 Oct 2023 03:21:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7MKwJvHVPZ54HZ2hHFhlzW5WzWIp+TEHAFa7WeB07lZgZAWmB89imGgqBsdgNhGpzRdP7 X-Received: by 2002:a05:6a20:da87:b0:167:af7d:9e8c with SMTP id iy7-20020a056a20da8700b00167af7d9e8cmr4845116pzb.56.1697624501130; Wed, 18 Oct 2023 03:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697624501; cv=none; d=google.com; s=arc-20160816; b=Gx066qwXld4Q1nUFUlkYkh6/wexXQFxVnWfXdfbeI7Z7kkL+gy6D7QDiKkwCLhaCqw Xv352G0kNb0V0b9rVEldqkMthHhhLP9wU8tQiptCuUM9Lsf6gvAGyXx68XA+MuMdG8wO SkvHE9Uyn5vPjZpqKRa8dtVyXgqBl9bzD/I0+cBJlnmxCJStSq88LN/q1hfo1nfeRoNi J6tA4ySURd91/XIn3GiXB4XI6FjtijGrqla6FlH1QUdNJBd8MmgbmlzwnFjzFltyx+5Q jZcB/aQ3vIKRyE4HmTqox5KNd79z8IAAznmQDi1w7KMI7cuyYNxxo1NCCWRlyyjAdCAl JZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4NQmXh5DgD5FCRDoX7njGdeBFSEHaOg28db7b5cONLI=; fh=p4Rd6Og0U6VXu2fJQVVeNTp2toZAaOQQ4wWgC6l5umE=; b=FAX08lS3rX134YGagNbADV69FAeGEwvzWxeTv4vc9GQSa2wCSTEwczv1yQuRLIKJqb se/YUbPjsWsAPxnX4CWlvAIntj9DfO2G5DbBGePQhjuR9zKuL+8GReEceO0OXDxftyHJ 3bpwzUEpkk5QxqgEOtAc/VizcPNkQBNKZHVGxCiJg+2USZ13sxqlfaDjc4nVJqmCrgxk +QISd8sZazx9EnS63PX6fjaZc3TgsgkhvO//0E+DYwhyNKmZiE+13JElZfVULG/VUceN 8zZz4yC74LhlaVjh80LB8hCpZabVQbmF8JUxBRjXrml3rlrp9tZLiskB6TFZ01imTKzj ZiDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=hCWC5qQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l9-20020a170902d34900b001bb20380bf9si3667912plk.545.2023.10.18.03.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=hCWC5qQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4B1D081603B9; Wed, 18 Oct 2023 03:21:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjJRKVa (ORCPT + 99 others); Wed, 18 Oct 2023 06:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbjJRKVZ (ORCPT ); Wed, 18 Oct 2023 06:21:25 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43701EA for ; Wed, 18 Oct 2023 03:21:23 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c50906f941so74062221fa.2 for ; Wed, 18 Oct 2023 03:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1697624481; x=1698229281; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4NQmXh5DgD5FCRDoX7njGdeBFSEHaOg28db7b5cONLI=; b=hCWC5qQ3kxsv36wzbYR+1Q5XqtxC7HoTJ4vdsg6fZV94PgP/RUYGTs9JwpWHBGaxRm y2nEp7k/x8cwNQpjBjCxNN5BL5iV3OEDqNwLoqxa6YozchIKgXYkiK0aHHoluf7RXP71 96a0ZBgB3Eqy3o2U9pzmG5+2YNfjuVqv2gXV0D89vFz71ARF/BFVsvWwGgbL1FMBG7UY xq97tps4DsR+HjKVGKtasQuS4Rle/ZssfXtUpeRu/HeMsKXUe5Tm+yWC1cvLVRhR3gmf BIjKY7VcZeGPG9mwyD9Su/nGMvb5Gv0M0WyPFwxmc8w8UWFnk+6Yqv9gcc/W0LhHNcA+ VHEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697624481; x=1698229281; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4NQmXh5DgD5FCRDoX7njGdeBFSEHaOg28db7b5cONLI=; b=tPDBTtbgrYQf6yKrq+spLkKxHbsjeVn98LVM0/uhBYueUDaBbhhThGIFZRJaTudI6+ lCwVSQo6sLRBMd3Wey97XGeE68I5VmS6oDpck5x8NdjlpJFcpH/qQzRYq8AxbPbQMa7H Pz74959WC6DBROVjCWwRDfkTqJWSUPWd2pKgrypRV9Rk2bezRa08Rjle4iDlKUpDgEmH 5wOHsPnU0rtCLo4di+Ul5TLiXKOf7SJTVuErzNZ95a5H5s/wKKUKct/xyR/19Nnl2HIn bDzMS5vnrQjtJagyVqTGtNwTQh/wbWlsaFVM5RBSU+4lLXUdwWdwKjM5BSmPLcNI2m0e MsyA== X-Gm-Message-State: AOJu0YyM7Nm0vgnZYjMfJMx4H8RuTBUvrUNpm1KHLmS/JFQ1UPck3/Tg yh2kW8hERLuG3z9PLuMxYLK5w4D2jugp7bgXUd/K0A== X-Received: by 2002:a2e:8502:0:b0:2be:58f3:ccee with SMTP id j2-20020a2e8502000000b002be58f3cceemr3615874lji.41.1697624481214; Wed, 18 Oct 2023 03:21:21 -0700 (PDT) MIME-Version: 1.0 References: <202310172247.b9959bd4-oliver.sang@intel.com> In-Reply-To: <202310172247.b9959bd4-oliver.sang@intel.com> From: Max Kellermann Date: Wed, 18 Oct 2023 12:21:10 +0200 Message-ID: Subject: Re: [linux-next:master] [drivers/char/mem] 1b057bd800: stress-ng.splice.ops_per_sec -99.8% regression To: kernel test robot Cc: oe-lkp@lists.linux.dev, lkp@intel.com, Linux Memory Management List , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, ying.huang@intel.com, feng.tang@intel.com, fengwei.yin@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 03:21:38 -0700 (PDT) On Tue, Oct 17, 2023 at 5:07=E2=80=AFPM kernel test robot wrote: > 743.57 +334.3% 3229 =C4=85 3% stress-ng.splice.MB_pe= r_sec_splice_rate > 7.46e+08 -99.8% 1373628 =C4=85 3% stress-ng.splice.ops > 12433266 -99.8% 22893 =C4=85 3% stress-ng.splice.ops_p= er_sec I think this might be caused by a bug in stress-ng, leading to blocking pipe writes. This is how it looks before my patch: openat(AT_FDCWD, "/dev/zero", O_RDONLY) =3D 4 pipe2([5, 6], 0) =3D 0 fcntl(6, F_SETPIPE_SZ, 65536) =3D 65536 [...] write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= "..., 65536) =3D 65536 splice(5, NULL, 8, NULL, 65536, SPLICE_F_MOVE) =3D 65536 [...] splice(5, [1], 6, [1], 4096, SPLICE_F_MORE) =3D -1 ESPIPE (Illegal seek) splice(4, NULL, 6, [1], 65536, SPLICE_F_MOVE) =3D -1 ESPIPE (Illegal seek) splice(5, [1], 13, NULL, 65536, SPLICE_F_MORE) =3D -1 ESPIPE (Illegal seek= ) splice(4, NULL, 6, NULL, 0, 0) =3D 0 splice(4, NULL, 6, NULL, 1, SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT|0xfffffff0) =3D -1 EINVAL (Invalid argument) splice(4, NULL, 6, NULL, 1, 0) =3D -1 EINVAL (Invalid argument) splice(6, [0], 6, [0], 4096, SPLICE_F_MOVE) =3D -1 ESPIPE (Illegal seek) [...] write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= "..., 65536) =3D 65536 Each iteration writes 65536 bytes into the pipe and then reads those 65536 bytes back from the pipe. After my patch (but "use_splice" disabled manually so the syscalls are the same): openat(AT_FDCWD, "/dev/zero", O_RDONLY) =3D 4 pipe2([5, 6], 0) =3D 0 fcntl(6, F_SETPIPE_SZ, 65536) =3D 65536 [...] write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= "..., 65536) =3D 65536 splice(5, NULL, 8, NULL, 65536, SPLICE_F_MOVE) =3D 65536 [...] splice(5, [1], 6, [1], 4096, 0) =3D -1 ESPIPE (Illegal seek) splice(4, NULL, 6, [1], 65536, SPLICE_F_MORE) =3D -1 ESPIPE (Illegal seek) splice(5, [1], 13, NULL, 65536, 0) =3D -1 ESPIPE (Illegal seek) splice(4, NULL, 6, NULL, 0, SPLICE_F_MOVE|SPLICE_F_MORE) =3D 0 splice(4, NULL, 6, NULL, 1, SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT|0xfffffff0) =3D -1 EINVAL (Invalid argument) splice(4, NULL, 6, NULL, 1, 0) =3D 1 splice(6, [0], 6, [0], 4096, 0) =3D -1 ESPIPE (Illegal seek) [...] write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= "..., 65536) =3D 61440 --- SIGALRM {si_signo=3DSIGALRM, si_code=3DSI_KERNEL} --- Just as before, each iteration reads 65536 bytes from the pipe, but it will write an additional byte into the pipe, because the second splice(/dev/zero) did not fail with EINVAL! The next write() blocks because the pipe buffer is already full, eventually killing the process with SIGALRM due to timeout. Oliver, am I on the right track here? Is this really a bug in stress-ng? (I still don't get why the throughput increases.) Max