[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen: make multicall debug boot time selectable


  • To: Juergen Gross <jgross@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx
  • From: boris.ostrovsky@xxxxxxxxxx
  • Date: Fri, 5 Jul 2024 18:36:10 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Nxuhf13ZdvDaAF6OU+/qOUCx4GRcDHeYjHjf0UpD+tU=; b=f1rSJsHnlvWuz1xs08nd6fi8o2H8/vTDAhyTMU1n+UELIX8sLbaUYEvz+br8LiDkwN+XOtc4Rc71plnxdkf67Z4dZZBzbkWOG9fr6Kb51h3/duoIotQmkFNIi7m2i5r4Hlj+C+tmUURYq4i/wQZaFOc6cfQEkZM0/TkkCvtCQRX+6bUyvJTmFCPD2FvjlurF9Lz3ZhmcwxeAUBD575fr6AnQqex0IPkXLFlfKngh3SmTUgvuij9dtlXz/h/XjhH+xFtczOOcA8VxoeykWeIkBFFhDfI0ne7cr/lz/irQQYWkGtjm6Pfv5q4mpFVZAypq1LUgNjW0f6gUitM0jUp43w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EFRUjQFlq/9GyTlMCtItuANXxjBUUH5s9zZANdj71V8SBjlZKbNuwzXIEaaDrkBDeHqpJTbx0/TTaWrAu7K9faES0xcgDndee9udMHxFkKpWvZdxh5rwclsNaeYcTDV1AzWgn36JfmpUOMtRwrDE7bmdttfZAn8atrXUCMizKrCt98na2tVTUNRm/jaLHjpkbAchEO6qkLXwJ3i6pjsIJ+d4uOYEOjKp3Lr2PJG4AemM/xQexduVkZiLxFQBdBUMQrZT6TpD7//HdqLspEeFWU28LRkDRxkiHP1UMZ8xTymVhrLkr/k7WfqmWTDkrbPMzX2HrD6FSoVQnOo5fDkDEw==
  • Cc: Jonathan Corbet <corbet@xxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 05 Jul 2024 22:37:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 7/3/24 7:56 AM, Juergen Gross wrote:

#define MC_BATCH 32 -#define MC_DEBUG 0
-
  #define MC_ARGS               (MC_BATCH * 16)
struct mc_buffer {
        unsigned mcidx, argidx, cbidx;
        struct multicall_entry entries[MC_BATCH];
-#if MC_DEBUG
-       struct multicall_entry debug[MC_BATCH];
-       void *caller[MC_BATCH];
-#endif
        unsigned char args[MC_ARGS];
        struct callback {
                void (*fn)(void *);
@@ -50,13 +46,84 @@ struct mc_buffer {
        } callbacks[MC_BATCH];
  };
+struct mc_debug_data {
+       struct multicall_entry debug[MC_BATCH];

'entries'? It's a mc_debug_data's copy of mc_buffer's entries.

Also, would it be better to keep these fields as a struct of scalars and instead have the percpu array of this struct? Otherwise there is a whole bunch of [MC_BATCH] arrays, all of them really indexed by the same value. (And while at it, there is no reason to have callbacks[MC_BATCH] sized like that -- it has nothing to do with batch size and can probably be made smaller)


+       void *caller[MC_BATCH];
+       size_t argsz[MC_BATCH];
+};
+
  static DEFINE_PER_CPU(struct mc_buffer, mc_buffer);
+static struct mc_debug_data __percpu *mc_debug_data;
+static struct mc_debug_data mc_debug_data_early __initdata;

How about (I think this should work):

static struct mc_debug_data __percpu *mc_debug_data __refdata = &mc_debug_data_early;

Then you won't need get_mc_debug_ptr().


-boris



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.