Whamcloud - gitweb
LU-2049 grant: add support for OBD_CONNECT_GRANT_PARAM 93/7793/31
authorJohann Lombardi <johann.lombardi@intel.com>
Sat, 11 Jul 2015 00:23:28 +0000 (17:23 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 20 Feb 2016 05:39:56 +0000 (05:39 +0000)
commitbd1e41672c974b97148b65115185a57ca4b7bbde
tree906242df9394ecfd6542f0b83fab67d54b7886a6
parentf9ca359284357d145819beb08b316e932f7a3060
LU-2049 grant: add support for OBD_CONNECT_GRANT_PARAM

Add support for grant overhead calculation on the client side.
To do so, clients track usage on a per-extent basis. An extent is
composed of contiguous blocks.
The OST now returns to the OSC layer several parameters to consume
grant more accurately:
- the backend filesystem block size which is the minimal grant
  allocation unit;
- the maximum extent size;
- the extent insertion cost.
Clients now pack in bulk write how much grant space was consumed for
the RPC. Dirty data accounting also adopts the same scheme.

Moreover, each backend OSD now reports its own set of parameters:
- For ldiskfs, we usually have a 4KB block size with a maximum extent
  size of 32MB (theoretical limit of 128MB) and an extent insertion
  cost of 6 x 4KB = 24KB
- For ZFS, we report a block size of 128KB, an extent size of 128
  blocks (i.e. 16MB with 128KB block size) and a block insertion cost
  of 112KB.

Besides, there is now no more generic metadata overhead reservation
done inside each OSD. Instead grant space is inflated for clients
that do not support the new grant parameters. That said, a tiny
percentage (typically 0.76%) of the free space is still reserved
inside each OSD to avoid fragmentation which might hurt performance
and impact our grant calculation (e.g. extents are broken due to
fragmentation).

This patch also fixes several other issues:

- Bulk write resent by ptlrpc after reconnection could trigger
spurious error messages related to broken dirty accounting.
The issue was that oa_dirty is discarded for resent requests
(grant flag cleared in ost_brw_write()), so we can legitimately
have grant > fed_dirty in ofd_grant_check().
This was fixed by reseting fed_dirty on reconnection and skipping
the dirty accounting check in ofd_grant_check() in the case of
ptlrpc resend.

- In obd_connect_data_seqprint(), the connection flags cannot fit
  in a 32-bit integer.

- When merging two OSC extents, an extent tax should be released
  in both the merged extent and in the grant accounting.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I9c738235583324dfae7eade034db28a8161f8ef5
Reviewed-on: http://review.whamcloud.com/7793
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
24 files changed:
lustre/include/dt_object.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_export.h
lustre/include/obd.h
lustre/include/obd_support.h
lustre/llite/llite_lib.c
lustre/mdd/mdd_dir.c
lustre/obdclass/lprocfs_status.c
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_grant.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_obd.c
lustre/osc/lproc_osc.c
lustre/osc/osc_cache.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-zfs/osd_handler.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/mount_utils_ldiskfs.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c