Commit 1a01d6a9 authored by Timothy Smith's avatar Timothy Smith
Browse files

Cherry-pick some changes from innodb-5.1-ss2479 snapshot. Includes fixes for

Bug#36600 and Bug#36793:

Bug #36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number

Fix by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.

Bug #36793 rpl_innodb_bug28430 fails on Solaris

This is a back port from branches/zip. This code has been tested on a
big-endian machine too.
parent 0473a0d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2328,7 +2328,6 @@ buf_print(void)

	ut_a(buf_validate());
}
#endif /* UNIV_DEBUG */

/*************************************************************************
Returns the number of latched pages in the buffer pool. */
@@ -2361,6 +2360,7 @@ buf_get_latched_pages_number(void)

	return(fixed_pages_number);
}
#endif /* UNIV_DEBUG */

/*************************************************************************
Returns the number of pending buf pool ios. */
+2 −0
Original line number Diff line number Diff line
@@ -334,8 +334,10 @@ static SHOW_VAR innodb_status_variables[]= {
  (char*) &export_vars.innodb_buffer_pool_pages_flushed,  SHOW_LONG},
  {"buffer_pool_pages_free",
  (char*) &export_vars.innodb_buffer_pool_pages_free,	  SHOW_LONG},
#ifdef UNIV_DEBUG
  {"buffer_pool_pages_latched",
  (char*) &export_vars.innodb_buffer_pool_pages_latched,  SHOW_LONG},
#endif /* UNIV_DEBUG */
  {"buffer_pool_pages_misc",
  (char*) &export_vars.innodb_buffer_pool_pages_misc,	  SHOW_LONG},
  {"buffer_pool_pages_total",
+8 −5
Original line number Diff line number Diff line
@@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */
void
buf_print(void);
/*============*/

/*************************************************************************
Returns the number of latched pages in the buffer pool. */

ulint
buf_get_latched_pages_number(void);
/*==============================*/
#endif /* UNIV_DEBUG */

/************************************************************************
Prints a page to stderr. */

@@ -503,12 +511,7 @@ void
buf_page_print(
/*===========*/
	byte*	read_buf);	/* in: a database page */
/*************************************************************************
Returns the number of latched pages in the buffer pool. */

ulint
buf_get_latched_pages_number(void);
/*==============================*/
/*************************************************************************
Returns the number of pending buf pool ios. */

+2 −2
Original line number Diff line number Diff line
@@ -331,10 +331,10 @@ mach_write_to_2_little_endian(
Convert integral type from storage byte order (big endian) to
host byte order. */
UNIV_INLINE
void
ullint
mach_read_int_type(
/*===============*/
	byte*		dest,		/* out: where to write */
					/* out: integer value */
	const byte*	src,		/* in: where to read from */
	ulint		len,		/* in: length of src */
	ibool		unsigned_type);	/* in: signed or unsigned flag */
+22 −16
Original line number Diff line number Diff line
@@ -696,33 +696,39 @@ mach_write_to_2_little_endian(
Convert integral type from storage byte order (big endian) to
host byte order. */
UNIV_INLINE
void
ullint
mach_read_int_type(
/*===============*/
	byte*		dest,		/* out: where to write */
					/* out: integer value */
	const byte*	src,		/* in: where to read from */
	ulint		len,		/* in: length of src */
	ibool		unsigned_type)	/* in: signed or unsigned flag */
{
#ifdef WORDS_BIGENDIAN
	memcpy(dest, src, len);
	/* XXX this can be optimized on big-endian machines */

	ullint	ret;
	uint	i;

	if (unsigned_type || (src[0] & 0x80)) {

	if (!unsigned_type) {
		dest[0] ^= 128;
		ret = 0x0000000000000000ULL;
	} else {

		ret = 0xFFFFFFFFFFFFFF00ULL;
	}
#else
	byte*		ptr;

	/* Convert integer data from Innobase to a little-endian format,
	sign bit restored to normal. */
	if (unsigned_type) {

		ret |= src[0];
	} else {

	for (ptr = dest + len; ptr != dest; ++src) {
		--ptr;
		*ptr = *src;
		ret |= src[0] ^ 0x80;
	}

	if (!unsigned_type) {
		dest[len - 1] ^= 128;
	for (i = 1; i < len; i++) {
		ret <<= 8;
		ret |= src[i];
	}
#endif

	return(ret);
}
Loading