Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1083180imj; Thu, 14 Feb 2019 00:40:00 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibx/v703DhCBC4ox00aZqHsUM48eeVI+GBfN9Zogpbzs+jVu+SVi7c+rEO2g6yMUvH+CUU7 X-Received: by 2002:a17:902:6b87:: with SMTP id p7mr2980377plk.282.1550133600370; Thu, 14 Feb 2019 00:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550133600; cv=none; d=google.com; s=arc-20160816; b=yUefJxEk2ZusJwW2iWO+EWYa+PcFR1g3NUpYNI63tFZdcDekHAQqnqOoBTzvo0p9pG 4i3EYDrAgVFd37YhpqXZW0wC+2N9ShztItkDrePBRUMk6i2S+jlUL4Vq7EPbBU7KhqDn mt6QhrIYO9TZrevdmusDh4hDjB2sZW4Qg2z+7dh+1+9n2f3wS10pZ0/jTmPowxS1d3hc UvmJDmDzzIDS7VLxyL2z9ep0Eynb0w+RHQP2tSkC9m0TsJ/Ip1B9wkiWOmM0nCEnKmXd nUj2N3w7eUtcOaUo9q8na0ymQ28NLAu6O6G6W44p9wztWFxzpziGk2+Px/l+H/PXfenC yggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=HzhQaGiMD2Kbo9RwshR9uKQOLpMXHBFaj9IEGbE21U8=; b=B2GPW7kH4HnXx1qnQmVOJkLLrtKILHIVe6R+Cq3BiKRrIK4TNIAIwOv8OZpfz/d3By KLwsZQmglqe7EOEsSVQGD8GTCuH/0HEKXZcUPVVKNJRc/RwJtEIIbQ689QzxuTHd7Yj8 AXwTYzUqEgxK1gqCZdYNBxpuxS1sogMGfKicoyMaNFcegxBsi6MhGg6LOfBzpwWvqxhD sAQmAHhi4tB/Zv83hvYn/Tzt3wCmr4uNt8D1+CVT9HQF+t4BjiNI2k32cV5ZdShtHli+ oJBlKFr5vu8xE9vb5QW851lIDe2RvOofh9Eec6VHQxFXtzzsmS8OsO7IRKzhAO2Cm9IY a0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pH5JZYQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si1758339pfm.242.2019.02.14.00.39.44; Thu, 14 Feb 2019 00:40:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pH5JZYQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390673AbfBMV0h (ORCPT + 99 others); Wed, 13 Feb 2019 16:26:37 -0500 Received: from mail-it1-f175.google.com ([209.85.166.175]:50360 "EHLO mail-it1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732034AbfBMV0h (ORCPT ); Wed, 13 Feb 2019 16:26:37 -0500 Received: by mail-it1-f175.google.com with SMTP id z7so9610151iti.0 for ; Wed, 13 Feb 2019 13:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=HzhQaGiMD2Kbo9RwshR9uKQOLpMXHBFaj9IEGbE21U8=; b=pH5JZYQm3/iQKZuCKQ2FtvSLiPiA/f8FrOiA09HG58eHpH36rKdBJLqA00jBU7yumx kYnGJYBs04i/KNUt3kRMUnKOzeSDu471L5B57lFI99mvjlLH8AzlV0wd2DjGiwcBTCWS T7ksz3899rdBxtxeGVVwFWIqB7pHfvN50g4oSvzeSb9Vfo/YI2w3tzOLNg3DaDkDV4vD 7FQJH6Ianq5Tt6EdQs7gQpeuUZ9a9RYI6xh/RmVqKwS6jyq+oF7EBsuZgWZ0nEQ1/EIz ALGL4RUbbncjd8VvRZ6nqjN9erb3yVrrairpJi0lSIaCyWPOXTVs5KTffkoBCnx4epjD zItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=HzhQaGiMD2Kbo9RwshR9uKQOLpMXHBFaj9IEGbE21U8=; b=MQEFvAza76UW9gT2NJ0TSu4sMguEyLswBJUZjDJVLEvcieFe73ZRjIRLJiYASfD73M IA4HHYOlS3Qet7nRbN1aHSm3ExbHHmfTgaeGZx3SpHZG5WhCucsK1ZqWljuKHXJyApBq emVy9dhOF5kaSPk19YyBw2j/6R8VdKTvEySxCpKDJrD2A1L6eEkq1IH8j2fqHzpJCI// vFNBrVcnn4Prajb2T3hnceKpLYRO748XKWH4jikL0uQdiGsiUCSLbbuXjaGN06bTI4pj k3YP+CshBw1dch86LhrSkz5ePy9/05TAj9PRcbT1HkbSN/2rnReHugFip4k7EBpppxrp dmAw== X-Gm-Message-State: AHQUAuabHY1BTFfjYMnlizwAifqwLfo2PLPB/mjBOq1/nAVvawcBU3L+ 14YnKSkC6YmO+y/x82B2JxDDPcqJVjE4h1BuBcduHg== X-Received: by 2002:a6b:c8cc:: with SMTP id y195mr163011iof.86.1550093196119; Wed, 13 Feb 2019 13:26:36 -0800 (PST) MIME-Version: 1.0 From: Mathieu Poirier Date: Wed, 13 Feb 2019 14:26:25 -0700 Message-ID: Subject: [v5.0-rc6 regression] "perf/core: Don't WARN() for impossible ring-buffer sizes" To: Mark Rutland , Peter Zijlstra , julien.thierry@arm.com Cc: Alexander Shishkin , Leo Yan , Ingo Molnar , Coresight ML , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, CoreSight trace collection is broken on v5.0-rc6 due to this commit: 9dff0aa95a32 perf/core: Don't WARN() for impossible ring-buffer sizes Before: root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/u --per-thread uname [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.036 MB perf.data ] root@juno:/home/linaro# After: root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/u --per-thread uname failed to mmap with 12 (Cannot allocate memory) root@juno:/home/linaro# The problem is related to the order_base_2() [1] test with a size of 1264, stemming from nr_pages equal to 128. The combination yields an order of 11, something leading directly to the error path. The results are the same with linux-next 20190213. This was tested on a Juno R0 and R1 with a 4K page configuration. I haven't tried but I'm pretty sure it breaks IntelPT as well. Please have a look when you have a minute. Leo Yan and I will be happy to test patches. Thanks, Mathieu [1]. https://elixir.bootlin.com/linux/v5.0-rc6/source/kernel/events/ring_buffer.c#L737