From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbdKMIC7 (ORCPT ); Mon, 13 Nov 2017 03:02:59 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:51881 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbdKMIC5 (ORCPT ); Mon, 13 Nov 2017 03:02:57 -0500 X-Google-Smtp-Source: AGs4zMaPY1VaFVLNRD/dHK+/YG3U5pYZ8vIuQo7lGZm5VBcwH0G87CqqkdmM1SejoyvtBzj0FNM7OOWxbtebKt4SeeI= MIME-Version: 1.0 In-Reply-To: <20171113074644.GA18733@krava> References: <20171108141522.GA6320@krava> <20171108151218.GA11018@krava> <20171108155741.GA12627@krava> <20171109074658.GC14419@krava> <20171109131233.GA2942@krava> <20171113074644.GA18733@krava> From: Milind Chabbi Date: Mon, 13 Nov 2017 00:02:56 -0800 X-Google-Sender-Auth: 0FDCND_N8hSXRAR59JHpPuoDOQA Message-ID: Subject: Re: [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT To: Jiri Olsa Cc: Milind Chabbi , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org, Michael Kerrisk-manpages , linux-man@vger.kernel.org, Michael Ellerman , Andi Kleen , Kan Liang , Hari Bathini , Sukadev Bhattiprolu , Jin Yao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SNIP On Sun, Nov 12, 2017 at 11:46 PM, Jiri Olsa wrote: > but you closed fd4 before openning fd5..? Yes, that is correct. I closed fd4. The reason is by closing fd4, we are having a total of 3 hardware breakpoints active, but we are making the software counting in the kernel think that four TYPE_DATA breakpoints active. The counting should have disallowed us from creating fd5 as per the following logic in the kernel: static int __reserve_bp_slot(struct perf_event *bp) { .... /* Flexible counters need to keep at least one slot */ if (slots.pinned + (!!slots.flexible) > nr_slots[type]) return -ENOSPC; .... }