~ubuntu-branches/ubuntu/quantal/mysql-5.5/quantal-security

« back to all changes in this revision

Viewing changes to storage/innobase/buf/buf0lru.c

  • Committer: Package Import Robot
  • Author(s): Seth Arnold
  • Date: 2013-04-18 18:15:39 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130418181539-7uo1w041b4h2ulbs
Tags: 5.5.31-0ubuntu0.12.10.1
* SECURITY UPDATE: Update to 5.5.31 to fix security issues (LP: #1170516)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html
* debian/patches/71_disable_rpl_tests.patch: refreshed.
* debian/patches/fix-mysqldump-test.patch: removed, fixed differently
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
                                be in a state where it can be freed */
152
152
 
153
153
/******************************************************************//**
 
154
Increases LRU size in bytes with zip_size for compressed page,
 
155
UNIV_PAGE_SIZE for uncompressed page in inline function */
 
156
static inline
 
157
void
 
158
incr_LRU_size_in_bytes(
 
159
/*===================*/
 
160
        buf_page_t*     bpage,          /*!< in: control block */
 
161
        buf_pool_t*     buf_pool)       /*!< in: buffer pool instance */
 
162
{
 
163
        ulint           zip_size;
 
164
        ut_ad(buf_pool_mutex_own(buf_pool));
 
165
        zip_size = page_zip_get_size(&bpage->zip);
 
166
        buf_pool->stat.LRU_bytes += zip_size ? zip_size : UNIV_PAGE_SIZE;
 
167
        ut_ad(buf_pool->stat.LRU_bytes <= buf_pool->curr_pool_size);
 
168
}
 
169
 
 
170
/******************************************************************//**
154
171
Determines if the unzip_LRU list should be used for evicting a victim
155
172
instead of the general LRU list.
156
173
@return TRUE if should use unzip_LRU */
1356
1373
        buf_page_t*     bpage)  /*!< in: control block */
1357
1374
{
1358
1375
        buf_pool_t*     buf_pool = buf_pool_from_bpage(bpage);
 
1376
        ulint           zip_size;
1359
1377
 
1360
1378
        ut_ad(buf_pool);
1361
1379
        ut_ad(bpage);
1391
1409
        UT_LIST_REMOVE(LRU, buf_pool->LRU, bpage);
1392
1410
        ut_d(bpage->in_LRU_list = FALSE);
1393
1411
 
 
1412
        zip_size = page_zip_get_size(&bpage->zip);
 
1413
        buf_pool->stat.LRU_bytes -= zip_size ? zip_size : UNIV_PAGE_SIZE;
 
1414
 
1394
1415
        buf_unzip_LRU_remove_block_if_needed(bpage);
1395
1416
 
1396
1417
        /* If the LRU list is so short that LRU_old is not defined,
1451
1472
}
1452
1473
 
1453
1474
/******************************************************************//**
1454
 
Adds a block to the LRU list end. */
 
1475
Adds a block to the LRU list end. Please make sure that the zip_size is
 
1476
already set into the page zip when invoking the function, so that we
 
1477
can get correct zip_size from the buffer page when adding a block
 
1478
into LRU */
1455
1479
UNIV_INLINE
1456
1480
void
1457
1481
buf_LRU_add_block_to_end_low(
1470
1494
        UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage);
1471
1495
        ut_d(bpage->in_LRU_list = TRUE);
1472
1496
 
 
1497
        incr_LRU_size_in_bytes(bpage, buf_pool);
 
1498
 
1473
1499
        if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) {
1474
1500
 
1475
1501
                ut_ad(buf_pool->LRU_old);
1498
1524
}
1499
1525
 
1500
1526
/******************************************************************//**
1501
 
Adds a block to the LRU list. */
 
1527
Adds a block to the LRU list. Please make sure that the zip_size is
 
1528
already set into the page zip when invoking the function, so that we
 
1529
can get correct zip_size from the buffer page when adding a block
 
1530
into LRU */
1502
1531
UNIV_INLINE
1503
1532
void
1504
1533
buf_LRU_add_block_low(
1540
1569
 
1541
1570
        ut_d(bpage->in_LRU_list = TRUE);
1542
1571
 
 
1572
        incr_LRU_size_in_bytes(bpage, buf_pool);
 
1573
 
1543
1574
        if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) {
1544
1575
 
1545
1576
                ut_ad(buf_pool->LRU_old);
1567
1598
}
1568
1599
 
1569
1600
/******************************************************************//**
1570
 
Adds a block to the LRU list. */
 
1601
Adds a block to the LRU list. Please make sure that the zip_size is
 
1602
already set into the page zip when invoking the function, so that we
 
1603
can get correct zip_size from the buffer page when adding a block
 
1604
into LRU */
1571
1605
UNIV_INTERN
1572
1606
void
1573
1607
buf_LRU_add_block(
1753
1787
                                UT_LIST_INSERT_AFTER(LRU, buf_pool->LRU,
1754
1788
                                                     prev_b, b);
1755
1789
 
 
1790
                                incr_LRU_size_in_bytes(b, buf_pool);
 
1791
 
1756
1792
                                if (buf_page_is_old(b)) {
1757
1793
                                        buf_pool->LRU_old_len++;
1758
1794
                                        if (UNIV_UNLIKELY