Deleted Added
full compact
vdev_queue.c (260763) vdev_queue.c (269418)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 10 unchanged lines hidden (view full) ---

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 10 unchanged lines hidden (view full) ---

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/*
27 * Copyright (c) 2013 by Delphix. All rights reserved.
27 * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
28 */
29
30#include <sys/zfs_context.h>
31#include <sys/vdev_impl.h>
32#include <sys/spa_impl.h>
33#include <sys/zio.h>
34#include <sys/avl.h>
35#include <sys/dsl_pool.h>

--- 367 unchanged lines hidden (view full) ---

403 return (zfs_vdev_scrub_min_active);
404 default:
405 panic("invalid priority %u", p);
406 return (0);
407 }
408}
409
410static int
28 */
29
30#include <sys/zfs_context.h>
31#include <sys/vdev_impl.h>
32#include <sys/spa_impl.h>
33#include <sys/zio.h>
34#include <sys/avl.h>
35#include <sys/dsl_pool.h>

--- 367 unchanged lines hidden (view full) ---

403 return (zfs_vdev_scrub_min_active);
404 default:
405 panic("invalid priority %u", p);
406 return (0);
407 }
408}
409
410static int
411vdev_queue_max_async_writes(uint64_t dirty)
411vdev_queue_max_async_writes(spa_t *spa)
412{
413 int writes;
412{
413 int writes;
414 uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total;
414 uint64_t min_bytes = zfs_dirty_data_max *
415 zfs_vdev_async_write_active_min_dirty_percent / 100;
416 uint64_t max_bytes = zfs_dirty_data_max *
417 zfs_vdev_async_write_active_max_dirty_percent / 100;
418
415 uint64_t min_bytes = zfs_dirty_data_max *
416 zfs_vdev_async_write_active_min_dirty_percent / 100;
417 uint64_t max_bytes = zfs_dirty_data_max *
418 zfs_vdev_async_write_active_max_dirty_percent / 100;
419
420 /*
421 * Sync tasks correspond to interactive user actions. To reduce the
422 * execution time of those actions we push data out as fast as possible.
423 */
424 if (spa_has_pending_synctask(spa)) {
425 return (zfs_vdev_async_write_max_active);
426 }
427
419 if (dirty < min_bytes)
420 return (zfs_vdev_async_write_min_active);
421 if (dirty > max_bytes)
422 return (zfs_vdev_async_write_max_active);
423
424 /*
425 * linear interpolation:
426 * slope = (max_writes - min_writes) / (max_bytes - min_bytes)

--- 16 unchanged lines hidden (view full) ---

443 switch (p) {
444 case ZIO_PRIORITY_SYNC_READ:
445 return (zfs_vdev_sync_read_max_active);
446 case ZIO_PRIORITY_SYNC_WRITE:
447 return (zfs_vdev_sync_write_max_active);
448 case ZIO_PRIORITY_ASYNC_READ:
449 return (zfs_vdev_async_read_max_active);
450 case ZIO_PRIORITY_ASYNC_WRITE:
428 if (dirty < min_bytes)
429 return (zfs_vdev_async_write_min_active);
430 if (dirty > max_bytes)
431 return (zfs_vdev_async_write_max_active);
432
433 /*
434 * linear interpolation:
435 * slope = (max_writes - min_writes) / (max_bytes - min_bytes)

--- 16 unchanged lines hidden (view full) ---

452 switch (p) {
453 case ZIO_PRIORITY_SYNC_READ:
454 return (zfs_vdev_sync_read_max_active);
455 case ZIO_PRIORITY_SYNC_WRITE:
456 return (zfs_vdev_sync_write_max_active);
457 case ZIO_PRIORITY_ASYNC_READ:
458 return (zfs_vdev_async_read_max_active);
459 case ZIO_PRIORITY_ASYNC_WRITE:
451 return (vdev_queue_max_async_writes(
452 spa->spa_dsl_pool->dp_dirty_total));
460 return (vdev_queue_max_async_writes(spa));
453 case ZIO_PRIORITY_SCRUB:
454 return (zfs_vdev_scrub_max_active);
455 default:
456 panic("invalid priority %u", p);
457 return (0);
458 }
459}
460

--- 325 unchanged lines hidden ---
461 case ZIO_PRIORITY_SCRUB:
462 return (zfs_vdev_scrub_max_active);
463 default:
464 panic("invalid priority %u", p);
465 return (0);
466 }
467}
468

--- 325 unchanged lines hidden ---