~jobinau/drizzle/bug_654164

« back to all changes in this revision

Viewing changes to plugin/innobase/buf/buf0rea.c

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        ulint   zip_size,/*!< in: compressed page size in bytes, or 0 */
172
172
        ulint   offset) /*!< in: page number */
173
173
{
 
174
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
174
175
        ib_int64_t      tablespace_version;
175
176
        ulint           count;
176
177
        ulint           err;
195
196
        }
196
197
 
197
198
        /* Flush pages from the end of the LRU list if necessary */
198
 
        buf_flush_free_margin();
 
199
        buf_flush_free_margin(buf_pool);
199
200
 
200
201
        /* Increment number of I/O operations used for LRU policy. */
201
202
        buf_LRU_stat_inc_io();
236
237
        ulint   offset) /*!< in: page number of a page; NOTE: the current thread
237
238
                        must want access to this page (see NOTE 3 above) */
238
239
{
 
240
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
239
241
        ib_int64_t      tablespace_version;
240
242
        buf_page_t*     bpage;
241
243
        buf_frame_t*    frame;
251
253
        ulint           err;
252
254
        ulint           i;
253
255
        const ulint     buf_read_ahead_linear_area
254
 
                = BUF_READ_AHEAD_LINEAR_AREA;
 
256
                = BUF_READ_AHEAD_LINEAR_AREA(buf_pool);
255
257
        ulint           threshold;
256
258
 
257
259
        if (UNIV_UNLIKELY(srv_startup_is_before_trx_rollback_phase)) {
286
288
 
287
289
        tablespace_version = fil_space_get_version(space);
288
290
 
289
 
        buf_pool_mutex_enter();
 
291
        buf_pool_mutex_enter(buf_pool);
290
292
 
291
293
        if (high > fil_space_get_size(space)) {
292
 
                buf_pool_mutex_exit();
 
294
                buf_pool_mutex_exit(buf_pool);
293
295
                /* The area is not whole, return */
294
296
 
295
297
                return(0);
297
299
 
298
300
        if (buf_pool->n_pend_reads
299
301
            > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
300
 
                buf_pool_mutex_exit();
 
302
                buf_pool_mutex_exit(buf_pool);
301
303
 
302
304
                return(0);
303
305
        }
315
317
        /* How many out of order accessed pages can we ignore
316
318
        when working out the access pattern for linear readahead */
317
319
        threshold = ut_min((64 - srv_read_ahead_threshold),
318
 
                           BUF_READ_AHEAD_AREA);
 
320
                           BUF_READ_AHEAD_AREA(buf_pool));
319
321
 
320
322
        fail_count = 0;
321
323
 
322
324
        for (i = low; i < high; i++) {
323
 
                bpage = buf_page_hash_get(space, i);
 
325
                bpage = buf_page_hash_get(buf_pool, space, i);
324
326
 
325
 
                if ((bpage == NULL) || !buf_page_is_accessed(bpage)) {
 
327
                if (bpage == NULL || !buf_page_is_accessed(bpage)) {
326
328
                        /* Not accessed */
327
329
                        fail_count++;
328
330
 
346
348
 
347
349
                if (fail_count > threshold) {
348
350
                        /* Too many failures: return */
349
 
                        buf_pool_mutex_exit();
 
351
                        buf_pool_mutex_exit(buf_pool);
350
352
                        return(0);
351
353
                }
352
354
 
358
360
        /* If we got this far, we know that enough pages in the area have
359
361
        been accessed in the right order: linear read-ahead can be sensible */
360
362
 
361
 
        bpage = buf_page_hash_get(space, offset);
 
363
        bpage = buf_page_hash_get(buf_pool, space, offset);
362
364
 
363
365
        if (bpage == NULL) {
364
 
                buf_pool_mutex_exit();
 
366
                buf_pool_mutex_exit(buf_pool);
365
367
 
366
368
                return(0);
367
369
        }
387
389
        pred_offset = fil_page_get_prev(frame);
388
390
        succ_offset = fil_page_get_next(frame);
389
391
 
390
 
        buf_pool_mutex_exit();
 
392
        buf_pool_mutex_exit(buf_pool);
391
393
 
392
394
        if ((offset == low) && (succ_offset == offset + 1)) {
393
395
 
466
468
        os_aio_simulated_wake_handler_threads();
467
469
 
468
470
        /* Flush pages from the end of the LRU list if necessary */
469
 
        buf_flush_free_margin();
 
471
        buf_flush_free_margin(buf_pool);
470
472
 
471
473
#ifdef UNIV_DEBUG
472
474
        if (buf_debug_prints && (count > 0)) {
518
520
#ifdef UNIV_IBUF_DEBUG
519
521
        ut_a(n_stored < UNIV_PAGE_SIZE);
520
522
#endif
521
 
        while (buf_pool->n_pend_reads
522
 
               > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
523
 
                os_thread_sleep(500000);
524
 
        }
525
523
 
526
524
        for (i = 0; i < n_stored; i++) {
527
 
                ulint   zip_size = fil_space_get_zip_size(space_ids[i]);
528
 
                ulint   err;
 
525
                ulint           err;
 
526
                buf_pool_t*     buf_pool;
 
527
                ulint           zip_size = fil_space_get_zip_size(space_ids[i]);
 
528
 
 
529
                buf_pool = buf_pool_get(space_ids[i], space_versions[i]);
 
530
 
 
531
                while (buf_pool->n_pend_reads
 
532
                       > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
 
533
                        os_thread_sleep(500000);
 
534
                }
529
535
 
530
536
                if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
531
537
 
550
556
 
551
557
        os_aio_simulated_wake_handler_threads();
552
558
 
553
 
        /* Flush pages from the end of the LRU list if necessary */
554
 
        buf_flush_free_margin();
 
559
        /* Flush pages from the end of all the LRU lists if necessary */
 
560
        buf_flush_free_margins();
555
561
 
556
562
#ifdef UNIV_DEBUG
557
563
        if (buf_debug_prints) {
600
606
        tablespace_version = fil_space_get_version(space);
601
607
 
602
608
        for (i = 0; i < n_stored; i++) {
 
609
                buf_pool_t*     buf_pool;
603
610
 
604
611
                count = 0;
605
612
 
606
613
                os_aio_print_debug = FALSE;
607
 
 
 
614
                buf_pool = buf_pool_get(space, page_nos[i]);
608
615
                while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) {
609
616
 
610
617
                        os_aio_simulated_wake_handler_threads();
643
650
 
644
651
        os_aio_simulated_wake_handler_threads();
645
652
 
646
 
        /* Flush pages from the end of the LRU list if necessary */
647
 
        buf_flush_free_margin();
 
653
        /* Flush pages from the end of all the LRU lists if necessary */
 
654
        buf_flush_free_margins();
648
655
 
649
656
#ifdef UNIV_DEBUG
650
657
        if (buf_debug_prints) {