Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933055Ab3DYRhl (ORCPT ); Thu, 25 Apr 2013 13:37:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65020 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932340Ab3DYRhk (ORCPT ); Thu, 25 Apr 2013 13:37:40 -0400 Date: Thu, 25 Apr 2013 19:33:56 +0200 From: Oleg Nesterov To: Jacob Shin Cc: Frederic Weisbecker , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org, Stephane Eranian , Jiri Olsa , linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 1/4] perf: Add hardware breakpoint address mask Message-ID: <20130425173356.GA2194@redhat.com> References: <1366703825-19373-1-git-send-email-jacob.shin@amd.com> <1366703825-19373-2-git-send-email-jacob.shin@amd.com> <20130423131844.GA24467@redhat.com> <20130423142546.GA17021@jshin-Toonie> <20130425151035.GA26760@redhat.com> <20130425165902.GA31751@jshin-Toonie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130425165902.GA31751@jshin-Toonie> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1599 Lines: 52 On 04/25, Jacob Shin wrote: > > On Thu, Apr 25, 2013 at 05:10:35PM +0200, Oleg Nesterov wrote: > > On 04/25, Frederic Weisbecker wrote: > > > > > > Do we need len and mask to work at the same time? I can't think of a > > > situation when len and mask mix up together in a useful way to define > > > a range. > > Okay, we can make it: > > union { > __u64 bp_len; > __u64 bp_addr_mask; > __config2; > }; > > And in x86, bp_len != HW_BREAKPOINT_LEN_1,2,4,8 will be interpreted as > bp_addr_mask. I think this can work too. And this needs almost the same changes as extending ->bp_len. > > Well. Another option is to extend bp_len. Fortunately HW_BREAKPOINT_LEN_* > > match the length, so we can simply allow any 2^n length and amd.c can > > translate it into the mask. > > Okay, this is nice because we can just ride on top of what already exits, > but ... Yes, yes, I agree with your "but". As I said from the very beginning I am not sure about this idea. > addr of 0x1000 and mask of 0xf0 will count accesses to: > > 0x1000, 0x1010, 0x1020, .. 0x10e0, 0x10f0 > > Maybe there is some big blob of data and user wants to see how many times > 16 byte aligned addresses get hit. This might be not as common, but it is > plausible no? I'd say this is certainly uncommon ;) But in any case we should not limit a user, so I agree. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/