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

Re: [PATCH 07/12] xen/common: add colored heap info debug-key


  • To: Carlo Nonato <carlo.nonato@xxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 26 Aug 2022 16:13:36 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=oDSqoc/kHXcDb3Zoc/tNtgIufqo0db/FBmvIaxl2+OI=; b=fBmkR8tnbUWarl6NtWDB/S8vSz+l8zj++Ec9Xir4vbigfCjv0UOB/N7Hdn3TYxPQNVtQJl1OwcWBIqjMS2nxogGrf264s0ubn0UVGHwZhwnM8QWLcH5ajTDvDfCJvswq4Rt5qQjlSAV6uOATQJ6UhYxgkU6jWwNWnnnxnpDwxvAHTQIchNvCNSBr1b8oNovVdV/g/A/A+Kx2QzGOVeANjcMlULSnO6X6eyzT2ZEZ0eHnOGEgEqPfyNN29aRvh5mzNLqR8WLVdC0o5b7z/N6MatCcI9nYUT2MqmoCTm7Vb/coVpzqTtnKyKOfjtCEUFKwvB+4NDqqQILKCk89qUdHnA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PqPrZF0xzWAPn09+pZIhij8Jo08cjhtdouZ4oGYJ9L5G31MXiMFV3zRcNM9MpiZVh4uxKKMylw4/eYPr9fYU99/rq4fKDwzWOFC3s+3iCxRIABHY8dNBShyxURpdsbGwOc+xeW72y75x8K4QGB1pWm6vtPmszj6b1agYt2o2u1olnptU60Keaw5McAmkkdpHBwmNk/nZLG/f/8cvRA7var+SyY19gVLZQHLNnC/0Sr6zPT/TeIODSvmhjKso9mkHs1AizMI1EPXZD1RtiNUY4SBsEwN0V1pz0P6Kf1pe95UBTlJU6WMIO/YRiwVe65qAJ+r8hxPWHG1sd9Li0Qfgjw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, julien@xxxxxxx, stefano.stabellini@xxxxxxx, wl@xxxxxxx, marco.solieri@xxxxxxxxxx, andrea.bastoni@xxxxxxxxxxxxxxx, lucmiccio@xxxxxxxxx, Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 26 Aug 2022 14:13:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.08.2022 14:51, Carlo Nonato wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -605,6 +605,27 @@ static struct page_info *alloc_col_domheap_page(struct 
> domain *d,
>      return pg;
>  }
>  
> +static void dump_col_heap(unsigned char key)
> +{
> +    struct page_info *pg;

const and perhaps move into the loop's scope?

> +    unsigned long pages;
> +    unsigned int color;
> +
> +    printk("'%c' pressed -> dumping coloring heap info\n", key);
> +
> +    for ( color = 0; color < get_max_colors(); color++ )
> +    {
> +        printk("Heap[%u]: ", color);
> +        pages = 0;
> +        page_list_for_each( pg, colored_pages(color) )
> +        {
> +            BUG_ON(!(page_to_color(pg) == color));
> +            pages++;
> +        }

This is a very inefficient way for obtaining a count. On a large
system this loop is liable to take excessively long. I'm inclined
to say that even adding a call to process_pending_softirqs() isn't
going to make this work reasonably.

I'm also not convinced of having BUG_ON() in keyhandler functions
which are supposed to only dump state.

> @@ -2853,6 +2874,9 @@ static void cf_check dump_heap(unsigned char key)
>  static __init int cf_check register_heap_trigger(void)
>  {
>      register_keyhandler('H', dump_heap, "dump heap info", 1);
> +#ifdef CONFIG_CACHE_COLORING
> +    register_keyhandler('k', dump_col_heap, "dump coloring heap info", 1);
> +#endif

I question the consuming of a separate key for this purpose: What's
wrong with adding the functionality to dump_heap()?

Jan



 


Rackspace

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