lustre: sync closely to 2.13.52
Subsystems (3)
cover lustre: sync closely to 2.13.52
These patches need to be applied to the lustre-backport branch starting at commit a436653f641e4b3e2841f38113620535e918dd3f. Combining the work of Neil and myself this brings the lustre linux client up to just btefore the he landing of Direct I/O (LU-4198) support. Testing shows this work is pretty stable.
Alex Zhuravlev (19):
lustre: ptlrpc: idle connections can disconnect
lustre: osc: serialize access to idle_timeout vs cleanup
lustre: protocol: MDT as a statfs proxy
lustre: ptlrpc: new request vs disconnect race
lustre: ldlm: pass preallocated env to methods
lustre: mdc: use old statfs format
lustre: osc: re-check target versus available grant
lustre: ptlrpc: reset generation for old requests
lustre: osc: propagate grant shrink interval immediately
lustre: osc: grant shrink shouldn't account skipped OSC
lnet: libcfs: poll fail_loc in cfs_fail_timeout_set()
lustre: obdclass: put all service's env on the list
lustre: obdclass: use RCU to release lu_env_item
lustre: obd: add rmfid support
lustre: mdc: polling mode for changelog reader
lustre: llite: forget cached ACLs properly
lustre: ptlrpc: return proper error code
lustre: llite: statfs to use NODELAY with MDS
lustre: ptlrpc: suppress connection restored message
Alexander Boyko (9):
lustre: ldlm: fix l_last_activity usage
lustre: ptlrpc: don't zero request handle
lustre: mgc: don't proccess cld during stopping
lustre: llog: add startcat for wrapped catalog
lustre: llog: add synchronization for the last record
lustre: mdc: don't use ACL at setattr
lnet: adds checking msg len
lustre: llite: prevent mulitple group locks
lustre: obdclass: don't skip records for wrapped catalog
Alexander Zarochentsev (4):
lustre: llite: ll_fault should fail for insane file offsets
lustre: osc: don't re-enable grant shrink on reconnect
lustre: ptlrpc: grammar fix.
lustre: osc: glimpse and lock cancel race
Alexey Lyashkov (10):
lustre: lu_object: improve debug message for lu_object_put()
lnet: use right rtr address
lnet: use right address for routing message
lustre: mdc: reset lmm->lmm_stripe_offset in mdc_save_lovea
lustre: obdecho: reuse an cl env cache for obdecho survey
lustre: obdecho: avoid panic with partially object init
lustre: mgc: config lock leak
lnet: fix rspt counter
lnet: lnet response entries leak
lnet: avoid extra memory consumption
Alexey Zhuravlev (1):
lustre: grant: prevent overflow of o_undirty
Amir Shehata (87):
lnet: ko2iblnd: determine gaps correctly
lnet: refactor lnet_select_pathway()
lnet: add health value per ni
lnet: add lnet_health_sensitivity
lnet: add monitor thread
lnet: handle local ni failure
lnet: handle o2iblnd tx failure
lnet: handle socklnd tx failure
lnet: handle remote errors in LNet
lnet: add retry count
lnet: calculate the lnd timeout
lnet: sysfs functions for module params
lnet: timeout delayed REPLYs and ACKs
lnet: remove duplicate timeout mechanism
lnet: handle fatal device error
lnet: reset health value
lnet: add health statistics
lnet: Add ioctl to get health stats
lnet: remove obsolete health functions
lnet: set health value from user space
lnet: add global health statistics
lnet: print recovery queues content
lnet: health error simulation
lnet: lnd: conditionally set health status
lnet: router handling
lnet: update logging
lnet: lnd: Clean up logging
lnet: unlink md if fail to send recovery
lnet: set the health status correctly
lnet: Decrement health on timeout
lnet: properly error check sensitivity
lnet: configure recovery interval
lnet: separate ni state from recovery
lnet: handle multi-md usage
lnet: socklnd: improve scheduling algorithm
lnet: lnd: increase CQ entries
lnet: lnd: bring back concurrent_sends
lnet: use number of wrs to calculate CQEs
lnet: recovery event handling broken
lnet: clean mt_eqh properly
lnet: handle remote health error
lnet: setup health timeout defaults
lnet: fix cpt locking
lnet: detach response tracker
lnet: invalidate recovery ping mdh
lnet: fix list corruption
lnet: correct discovery LNetEQFree()
lnet: verify msg is commited for send/recv
lnet: select LO interface for sending
lnet: remove route add restriction
lnet: Discover routers on first use
lnet: use peer for gateway
lnet: lnet_add/del_route()
lnet: Do not allow deleting of router nis
lnet: router sensitivity
lnet: cache ni status
lnet: Cache the routing feature
lnet: peer aliveness
lnet: router aliveness
lnet: simplify lnet_handle_local_failure()
lnet: Cleanup rcd
lnet: modify lnd notification mechanism
lnet: use discovery for routing
lnet: MR aware gateway selection
lnet: consider alive_router_check_interval
lnet: allow deleting router primary_nid
lnet: transfer routers
lnet: handle health for incoming messages
lnet: misleading discovery seqno.
lnet: drop all rule
lnet: handle discovery off
lnet: handle router health off
lnet: push router interface updates
lnet: net aliveness
lnet: discover each gateway Net
lnet: look up MR peers routes
lnet: check peer timeout on a router
lnet: prevent loop in LNetPrimaryNID()
lnet: fix peer ref counting
lnet: honor discovery setting
lnet: warn if discovery is off
lnet: handle unlink before send completes
lnet: handle recursion in resend
lnet: discovery off route state update
lnet: o2iblnd: cache max_qp_wr
lnet: fix peer_ni selection
lnet: peer lookup handle shutdown
Andreas Dilger (55):
lustre: llite: increase whole-file readahead to RPC size
lustre: mdc: fix possible NULL pointer dereference
lustre: obdclass: allow specifying complex jobids
lustre: idl: remove obsolete directory split flags
lustre: obdecho: use vmalloc for lnb
lustre: mgc: remove obsolete IR swabbing workaround
lustre: mds: remove obsolete MDS_VTX_BYPASS flag
lustre: ptlrpc: fix return type of boolean functions
lustre: ptlrpc: remove obsolete OBD RPC opcodes
lustre: ptlrpc: assign specific values to MGS opcodes
lustre: ptlrpc: remove obsolete LLOG_ORIGIN_* RPCs
lustre: obdclass: remove unused ll_import_cachep
lustre: ptlrpc: add debugging for idle connections
lustre: mdc: move RPC semaphore code to lustre/osp
lustre: misc: name open file handles as such
lustre: osc: move obdo_cache to OSC code
lustre: idl: remove obsolete RPC flags
lustre: osc: clarify short_io_bytes is maximum value
lustre: misc: quiet console messages at startup
lustre: idl: use proper ATTR/MDS_ATTR/MDS_OPEN flags
lustre: lov: add debugging info for statfs
lustre: hsm: make changelog flag argument an enum
lustre: uapi: fix warnings when lustre_user.h included
lustre: ptlrpc: clean up rq_interpret_reply callbacks
lustre: lov: quiet lov_dump_lmm_ console messages
lustre: llite: remove cl_file_inode_init() LASSERT
lnet: libcfs: allow file/func/line passed to CDEBUG()
lustre: llite: enable flock mount option by default
lustre: lmv: avoid gratuitous 64-bit modulus
lustre: Ensure crc-t10pi is enabled.
lustre: lov: avoid signed vs. unsigned comparison
lustre: llite: limit statfs ffree if less than OST ffree
lustre: misc: delete OBD_IOC_PING_TARGET ioctl
lustre: misc: remove LIBCFS_IOC_DEBUG_MASK ioctl
lustre: obdclass: improve llog config record message
lustre: ptlrpc: allow stopping threads above threads_max
lustre: llite: improve max_readahead console messages
lustre: uapi: fix file heat support
lustre: mdt: improve IBITS lock definitions
lustre: obdclass: don't send multiple statfs RPCs
lustre: uapi: add unused enum obd_statfs_state
lustre: mdc: hold lock while walking changelog dev list
lustre: ptlrpc: make DEBUG_REQ messages consistent
lustre: obdclass: align to T10 sector size when generating guard
lustre: ptlrpc: fix watchdog ratelimit logic
lustre: llite: clear flock when using localflock
lustre: llite: limit max xattr size by kernel value
lustre: llite: report latency for filesystem ops
lustre: osc: allow increasing osc.*.short_io_bytes
lustre: ptlrpc: update wiretest for new values
lustre: uapi: LU-12521 llapi: add separate fsname and instance API
lustre: ptlrpc: show target name in req_history
lustre: llite: proper names/types for offset/pages
lustre: uapi: remove unused LUSTRE_DIRECTIO_FL
lnet: use conservative health timeouts
Andrew Perepechko (5):
lustre: build: armv7 client build fixes
lustre: osc: speed up page cache cleanup during blocking ASTs
lustre: ptlrpc: improve memory allocation for service RPCs
lustre: llite: optimizations for not granted lock processing
lnet: libcfs: crashes with certain cpu part numbers
Andriy Skulysh (16):
lustre: ptlrpc: ptlrpc_register_bulk() LBUG on ENOMEM
lustre: ptlrpc: Serialize procfs access to scp_hist_reqs using mutex
lustre: ptlrpc: ASSERTION(!list_empty(imp->imp_replay_cursor))
lustre: ptlrpc: connect vs import invalidate race
lnet: o2iblnd: ibc_rxs is created and freed with different size
lustre: ldlm: Lost lease lock on migrate error
lnet: o2iblnd: kib_conn leak
lustre: ptlrpc: Bulk assertion fails on -ENOMEM
lustre: ptlrpc: ASSERTION (req_transno < next_transno) failed
lustre: ptlrpc: ocd_connect_flags are wrong during reconnect
lustre: ptlrpc: Add increasing XIDs CONNECT2 flag
lustre: ptlrpc: don't reset lru_resize on idle reconnect
lustre: ptlrpc: resend may corrupt the data
lustre: ldlm: FLOCK request can be processed twice
lustre: ldlm: signal vs CP callback race
lustre: llite: eviction during ll_open_cleanup()
Ann Koehler (8):
lustre: llite: yield cpu after call to ll_agl_trigger
lustre: ptlrpc: Do not map unrecognized ELDLM errnos to EIO
lustre: llite: Lock inode on tiny write if setuid/setgid set
lustre: statahead: sa_handle_callback get lli_sa_lock earlier
lustre: ptlrpc: Add jobid to rpctrace debug messages
lnet: libcfs: Reduce memory frag due to HA debug msg
lustre: llite: release active extent on sync write commit
lustre: ptlrpc: ptlrpc_register_bulk LBUG on ENOMEM
Arshad Hussain (17):
lustre: osc: truncate does not update blocks count on client
lustre: lmv: Fix style issues for lmv_fld.c
lustre: llite: Fix style issues for llite_nfs.c
lustre: llite: Fix style issues for lcommon_misc.c
lustre: llite: Fix style issues for symlink.c
lustre: ptlrpc: Change static defines to use macro for sec_gc.c
lustre: ldlm: Fix style issues for ldlm_lockd.c
lustre: ldlm: Fix style issues for ldlm_request.c
lustre: ptlrpc: Fix style issues for sec_bulk.c
lustre: ldlm: Fix style issues for ptlrpcd.c
lustre: ptlrpc: Fix style issues for sec_null.c
lustre: ptlrpc: Fix style issues for service.c
lustre: ldlm: Fix style issues for ldlm_resource.c
lustre: ptlrpc: Fix style issues for sec_gc.c
lustre: ptlrpc: Fix style issues for llog_client.c
lnet: Change static defines to use macro for module.c
lustre: ldlm: Fix style issues for ldlm_lib.c
Artem Blagodarenko (1):
lnet: add fault injection for bulk transfers
Aurelien Degremont (1):
lnet: support non-default network namespace
Ben Evans (1):
lustre: headers: define pct(a,b) once
Bobi Jam (11):
lustre: osc: depart grant shrinking from pinger
lustre: osc: enable/disable OSC grant shrink
lustre: flr: add 'nosync' flag for FLR mirrors
lustre: mdc: grow lvb buffer to hold layout
lustre: flr: add mirror write command
lustre: llite: protect reading inode->i_data.nrpages
lustre: osc: limit chunk number of write submit
lustre: osc: prevent use after free
lustre: llite: error handling of ll_och_fill()
lustre: flr: avoid reading unhealthy mirror
lustre: llite: file write pos mimatch
Bruno Faccini (6):
lustre: obdclass: fix llog_cat_cleanup() usage on Client
lustre: ptlrpc: fix test_req_buffer_pressure behavior
lustre: ldlm: cleanup LVB handling
lustre: security: return security context for metadata ops
lustre: lov: new foreign LOV format
lustre: lmv: new foreign LMV format
Chris Horn (28):
lnet: Cleanup lnet_get_rtr_pool_cfg
lnet: Fix NI status in debugfs for loopback ni
lustre: ptlrpc: Add more flags to DEBUG_REQ_FLAGS macro
lnet: Protect lp_dc_pendq manipulation with lp_lock
lnet: Ensure md is detached when msg is not committed
lnet: Do not allow gateways on remote nets
lnet: Convert noisy timeout error to cdebug
lnet: Misleading error from lnet_is_health_check
lnet: Sync the start of discovery and monitor threads
lnet: Deprecate live and dead router check params
lnet: Detach rspt when md_threshold is infinite
lnet: Return EHOSTUNREACH for unreachable gateway
lnet: Defer rspt cleanup when MD queued for unlink
lnet: Don't queue msg when discovery has completed
lnet: Use alternate ping processing for non-mr peers
lnet: o2ib: Record rc in debug log on startup failure
lnet: o2ib: Reintroduce kiblnd_dev_search
lnet: Optimize check for routing feature flag
lnet: Wait for single discovery attempt of routers
lnet: Prefer route specified by rtr_nid
lnet: Add peer level aliveness information
lnet: Refactor lnet_find_best_lpni_on_net
lnet: Avoid comparing route to itself
lnet: Avoid extra lnet_remotenet lookup
lnet: Remove unused vars in lnet_find_route_locked
lnet: Refactor lnet_compare_routes
lnet: Fix source specified route selection
lnet: Do not assume peers are MR capable
Christopher J. Morrone (1):
lustre: ldlm: Make kvzalloc | kvfree use consistent
Di Wang (1):
lustre: llite: handle ORPHAN/DEAD directories
Emoly Liu (4):
lnet: fix nid range format '*@<net>' support
lustre: checksum: enable/disable checksum correctly
lustre: ptlrpc: check lm_bufcount and lm_buflen
lustre: ptlrpc: check buffer length in lustre_msg_string()
Fan Yong (3):
lustre: llite: return compatible fsid for statfs
lustre: llite: decrease sa_running if fail to start statahead
lustre: lfsck: layout LFSCK for mirrored file
Gu Zheng (3):
lustre: osc: cancel osc_lock list traversal once found the lock is
being used
lustre: ldlm: always cancel aged locks regardless enabling or
disabling lru resize
lustre: uapi: fix building fail against Power9 little endian
Hongchao Zhang (8):
lustre: mdc: resend quotactl if needed
lustre: quota: add default quota setting support
lustre: ptlrpc: race in AT early reply
lustre: ptlrpc: always unregister bulk
lustre: quota: protect quota flags at OSC
lustre: quota: make overquota flag for old req
lustre: fld: let's caller to retry FLD_QUERY
lustre: mdc: hold obd while processing changelog
Jacek Tomaka (1):
lustre: llite: Mark lustre_inode_cache as reclaimable
Jadhav Vikram (1):
lustre: lov: protected ost pool count updation
James Nunez (1):
lustre: llite: limit smallest max_cached_mb value
James Simmons (33):
lustre: always enable special debugging, fhandles, and quota support.
lustre: osc_cache: remove __might_sleep()
lustre: uapi: remove enum hsm_progress_states
lustre: uapi: sync enum obd_statfs_state
lustre: obd: create ping sysfs file
lustre: ldlm: change LDLM_POOL_ADD_VAR macro to inline function
lustre: osc: fix idle_timeout handling
lustre: ptlrpc: replace simple_strtol with kstrtol
lustre: obd: use correct ip_compute_csum() version
lustre: llite: create checksums to replace checksum_pages
lustre: obd: use correct names for conn_uuid
lustre: mgc: restore mgc binding for sptlrpc
lustre: update version to 2.11.99
lustre: obdclass: report all obd states for OBD_IOC_GETDEVICE
lustre: sysfs: make ping sysfs file read and writable
lustre: sptlrpc: split sptlrpc_process_config()
lustre: clio: fix incorrect invariant in cl_io_iter_fini()
lustre: obd: use ldo_process_config for mdc and osc layer
lustre: obd: make health_check sysfs compliant
lnet: properly cleanup lnet debugfs files
lustre: obd: update udev event handling
lustre: obd: replace class_uuid with linux kernel version.
lustre: obd: round values to nearest MiB for *_mb syfs files
lustre: obdclass: add comment for rcu handling in lu_env_remove
lustre: ptlrpc: change IMPORT_SET_* macros into real functions
lustre: obd: harden debugfs handling
lustre: update version to 2.13.50
lnet: timers: correctly offset mod_timer.
lustre: obd: perform proper division
lustre: llite: don't cache MDS_OPEN_LOCK for volatile files
lnet: socklnd: rename struct ksock_peer to struct ksock_peer_ni
lustre: sysfs: use string helper like functions for sysfs
lustre: uapi: properly pack data structures
Jian Yu (4):
lustre: mdt: revoke lease lock for truncate
lustre: llite: swab LOV EA user data
lustre: llite: swab LOV EA data in ll_getxattr_lov()
lustre: llite: fetch default layout for a directory
Jinshan Xiong (4):
lustre: llite: rename FSFILT_IOC_* to system flags
lustre: llite: optimize read on open pages
lustre: dne: performance improvement for file creation
lustre: llite: do not cache write open lock for exec file
John L. Hammond (12):
lustre: llite: reorganize variable and data structures
lustre: hsm: ignore compound_id
lustre: llog: remove obsolete llog handlers
lustre: obd: keep dirty_max_pages a round number of MB
lustre: llite: handle zero length xattr values correctly
lustre: mdc: remove obsolete intent opcodes
lustre: ldlm: correct logic in ldlm_prepare_lru_list()
lustre: llite: zero lum for stripeless files
lustre: mdc: move empty xattr handling to mdc layer
lustre: obd: remove portals handle from OBD import
lustre: llite: handle -ENODATA in ll_layout_fetch()
lustre: ldlm: remove trace from ldlm_pool_count()
Kit Westneat (1):
lnet: remove .nf_min_max handling
Lai Siyao (27):
lustre: ptlrpc: add dir migration connect flag
lustre: lmv: dir page is released while in use
lustre: migrate: pack lmv ea in migrate rpc
lustre: migrate: migrate striped directory
lustre: lmv: support accessing migrating directory
lustre: llite: add lock for dir layout data
lustre: lmv: allocate fid on parent MDT in migrate
lustre: obdclass: lu_dirent record length missing '0'
lustre: uapi: reserve connect flag for plain layout
lustre: dne: allow access to striped dir with broken layout
lustre: dne: add new dir hash type "space"
lustre: ptlrpc: intent_getattr fetches default LMV
lustre: mdc: add async statfs
lustre: lmv: mkdir with balanced space usage
lustre: lmv: reuse object alloc QoS code from LOD
lustre: obdclass: generate random u64 max correctly
lustre: uapi: change "space" hash type to hash flag
lustre: obdclass: 0-nlink race in lu_object_find_at()
lustre: mdc: dir page ldp_hash_end mistakenly adjusted
lustre: lmv: disable remote file statahead
lustre: lmv: use lu_tgt_descs to manage tgts
lustre: lmv: share object alloc QoS code with LMV
lustre: obdclass: qos penalties miscalculated
lustre: obdclass: lu_tgt_descs cleanup
lustre: lmv: alloc dir stripes by QoS
lustre: uapi: introduce OBD_CONNECT2_CRUSH
lustre: llite: fix deadlock in ll_update_lsm_md()
Li Dongyang (9):
lustre: ldlm: check double grant race after resource change
lustre: clio: use pagevec_release for many pages
lustre: osc: reduce atomic ops in osc_enter_cache_try
lustre: osc: check if opg is in lru list without locking
lustre: osc: don't check capability for every page
lustre: osc: reduce lock contention in osc_unreserve_grant
lustre: obdclass: protect imp_sec using rwlock_t
lustre: llite: create obd_device with usercopy whitelist
lustre: obdclass: remove assertion for imp_refcount
Li Xi (6):
lustre: osc: add T10PI support for RPC checksum
lustre: osc: wrong page offset for T10PI checksum
lustre: llite: add file heat support
lustre: llite: console message for disabled flock call
lustre: llite: cleanup stats of LPROC_LL_*
lustre: osc: add preferred checksum type support
Liang Zhen (2):
lustre: ldlm: don't disable softirq for exp_rpc_lock
lustre: obdclass: new wrapper to convert NID to string
Mike Marciniszyn (1):
lnet: libcfs: remove unnecessary set_fs(KERNEL_DS)
Mikhail Pershin (28):
lustre: mdc: deny layout swap for DoM file
lustre: ldlm: expose dirty age limit for flush-on-glimpse
lustre: ldlm: IBITS lock convert instead of cancel
lustre: ptlrpc: add LOCK_CONVERT connection flag
lustre: ldlm: handle lock converts in cancel handler
lustre: ldlm: don't add canceling lock back to LRU
lustre: mdt: read on open for DoM files
lustre: llite: check truncate race for DOM pages
lustre: ldlm: don't cancel DoM locks before replay
lustre: ptlrpc: don't change buffer when signature is ready
lustre: ldlm: update l_blocking_lock under lock
lustre: ldlm: don't apply ELC to converting and DOM locks
lustre: ldlm: don't skip bl_ast for local lock
lustre: mdt: fix read-on-open for big PAGE_SIZE
lustre: ldlm: don't convert wrong resource
lustre: mdc: prevent glimpse lock count grow
lustre: mdc: return DOM size on open resend
lustre: osc: pass client page size during reconnect too
lustre: mdt: fix mdt_dom_discard_data() timeouts
lustre: dom: per-resource ELC for WRITE lock enqueue
lustre: dom: mdc_lock_flush() improvement
lustre: obdclass: remove unprotected access to lu_object
lustre: llite: check correct size in ll_dom_finish_open()
lustre: ptlrpc: fix reply buffers shrinking and growing
lustre: dom: manual OST-to-DOM migration via mirroring
lustre: ptlrpc: do lu_env_refill for any new request
lustre: dom: check read-on-open buffer presents in reply
lustre: llog: keep llog handle alive until last reference
Mr NeilBrown (47):
lustre: obdclass: allow per-session jobids.
lustre: fld: remove fci_no_shrink field.
lustre: lustre: remove ldt_obd_type field of lu_device_type
lustre: lustre: remove imp_no_timeout field
lustre: llog: remove olg_cat_processing field.
lustre: ptlrpc: remove struct ptlrpc_bulk_page
lustre: ptlrpc: remove bd_import_generation field.
lustre: ptlrpc: remove srv_threads from struct ptlrpc_service
lustre: ptlrpc: remove scp_nthrs_stopping field.
lustre: ldlm: remove unused ldlm_server_conn
lustre: llite: remove lli_readdir_mutex
lustre: llite: remove ll_umounting field
lustre: llite: align field names in ll_sb_info
lustre: llite: remove lti_iter field
lustre: llite: remove ft_mtime field
lustre: llite: remove sub_reenter field.
lustre: osc: remove oti_descr oti_handle oti_plist
lustre: osc: remove oe_next_page
lnet: o2iblnd: remove some unused fields.
lnet: socklnd: remove ksnp_sharecount
lnet: change ln_mt_waitq to a completion.
lustre: import: Fix missing spin_unlock()
lustre: use simple sleep in some cases
lustre: modules: Use LIST_HEAD for declaring list_heads
lnet: remove pt_number from lnet_peer_table.
lustre: obdclass: Allow read-ahead for write requests
lnet: discard lnd_refcount
lnet: change ksocknal_create_peer() to return pointer
lnet: discard ksnn_lock
lnet: discard LNetMEInsert
lustre: all: prefer sizeof(*var) for alloc
lnet: always check return of try_module_get()
lnet: prepare to make lnet_lnd const.
lnet: discard struct ksock_peer
lnet: socklnd: initialize the_ksocklnd at compile-time.
lnet: remove locking protection ln_testprotocompat
lustre: handle: remove locking from class_handle2object()
lustre: obdclass: convert waiting in cl_sync_io_wait().
lnet: modules: use list_move were appropriate.
lnet: fix small race in unloading klnd modules.
lnet: me: discard struct lnet_handle_me
lnet: socklnd: convert peers hash table to hashtable.h
lustre: ptlrpc: simplify wait_event handling in unregister functions
lustre: ptlrpc: use l_wait_event_abortable in ptlrpcd_add_reg()
lnet: use LIST_HEAD() for local lists.
lustre: lustre: use LIST_HEAD() for local lists.
lnet: remove lnd_query interface.
Nathaniel Clark (1):
lustre: lov: Correct bounds checking
NeilBrown (18):
lustre: llite: Don't clear d_fsdata in ll_release()
lustre: llite: move agl_thread cleanup out of thread. lustre/lnet: remove unnecessary use of msecs_to_jiffies()
lnet: net_fault: don't pass struct member to do_div()
lustre: obd: discard unused enum
lustre: lov: use wait_event() in lov_subobject_kill()
lustre: llite: use wait_event in cl_object_put_last()
lustre: handle: move refcount into the lustre_handle.
lustre: ldlm: separate buckets from ldlm hash table
lustre: handle: discard OBD_FREE_RCU
lnet: use list_move where appropriate.
lustre: ldlm: add a counter to the per-namespace data
lustre: rename ops to owner
lustre: ldlm: simplify ldlm_ns_hash_defs[]
lustre: u_object: factor out extra per-bucket data
lustre: llite: replace lli_trunc_sem
lustre: handle: use hlist for hash lists.
lustre: handle: discard h_lock.
Olaf Faaland (2):
lnet: create existing net returns EEXIST
lustre: llite: Update mdc and lite stats on open|creat
Olaf Weber (1):
lnet: use after free in lnet_discover_peer_locked()
Oleg Drokin (6):
lustre: ptlrpc: Add WBC connect flag
lustre: lov: Move lov_tgts_kobj init to lov_setup
lustre: osc: increase default max_dirty_mb to 2G
lustre: llite: Revalidate dentries in ll_intent_file_open
lustre: llite: hash just created files if lock allows
lustre: ptlrpc: Properly swab ll_fiemap_info_key
Patrick Farrell (30):
lustre: osc: Do not request more than 2GiB grant
lustre: ldlm: Reduce debug to console during eviction
lustre: ptlrpc: Make CPU binding switchable
lustre: osc: Do not walk full extent list
lustre: ldlm: Adjust search_* functions
lustre: mdc: Improve xattr buffer allocations
lustre: llite: Initialize cl_dirty_max_pages
lustre: llite: ll_fault fixes
lustre: osd: Set max ea size to XATTR_SIZE_MAX
lustre: lov: Remove unnecessary assert
lustre: obd: Add overstriping CONNECT flag
lustre: lov: Add overstriping support
lustre: uapi: Add nonrotational flag to statfs
lustre: llite: collect debug info for ll_fsync
lustre: lu_object: Add missed qos_rr_init
lustre: osc: Do not assert for first extent
lustre: ptlrpc: Don't get jobid in body_v2
lustre: lov: Correct write_intent end for trunc
lustre: osc: Fix dom handling in weight_ast
lustre: llite: Fix extents_stats
lustre: ptlrpc: Stop sending ptlrpc_body_v2
lustre: uapi: Remove unused CONNECT flag
lustre: llite: Fix page count for unaligned reads
lustre: llite: Improve readahead RPC issuance
lustre: lov: Move page index to top level
lustre: ptlrpc: Hold imp lock for idle reconnect
lustre: osc: glimpse - search for active lock
lnet: o2iblnd: Make credits hiw connection aware
lustre: vvp: dirty pages with pagevec
lustre: llite: Accept EBUSY for page unaligned read
Qian Yingjin (16):
lustre: mdt: Lazy size on MDT
lustre: uapi: add new changerec_type
lustre: lsom: Add an OBD_CONNECT2_LSOM connect flag
lustre: pcc: Reserve a new connection flag for PCC
lustre: rpc: support maximum 64MB I/O RPC
lustre: llite: Add persistent cache on client
lustre: pcc: Non-blocking PCC caching
lustre: pcc: security and permission for non-root user access
lustre: llite: Rule based auto PCC caching when create files
lustre: pcc: auto attach during open for valid cache
lustre: pcc: change detach behavior and add keep option
lustre: som: integrate LSOM with lfs find
lustre: pcc: Auto attach for PCC during IO
lustre: pcc: Incorrect size after re-attach
lustre: pcc: auto attach not work after client cache clear
lustre: pcc: Init saved dataset flags properly
Quentin Bouget (1):
lustre: uapi: turn struct lustre_nfs_fid to userland fhandle
Rahul Deshmukh (1):
lustre: obdecho: turn on async flag only for mode 3
Rob Latham (1):
lustre: uapi: Make lustre_user.h c++-legal
Ryan Haasken (1):
lustre: obdclass: Add lbug_on_eviction option
Sebastien Buisson (7):
lustre: obd: check '-o network' and peer discovery conflict
lustre: cfg: reserve flags for SELinux status checking
lustre: sec: create new function sptlrpc_get_sepol()
lnet: check for asymmetrical route messages
lustre: ptlrpc: manage SELinux policy info at connect time
lustre: ptlrpc: manage SELinux policy info for metadata ops
lustre: sec: reserve flags for client side encryption
Sergey Cheremencev (1):
lustre: ptlrpc: IR doesn't reconnect after EAGAIN
Shaun Tancheff (7):
lustre: lov: return error if cl_env_get fails
lustre: llite: MS_* flags and SB_* flags split
lustre: clio: support custom csi_end_io handler
lnet: Fix style issues for selftest/rpc.c
lnet: Fix style issues for module.c conctl.c
lnet: libcfs: provide an scnprintf and start using it
lnet: libcfs: Cleanup use of bare printk
Sonia Sharma (6):
lnet: Fix selftest backward compatibility post health
lnet: socklnd: dynamically set LND parameters
lnet: peer deletion code may hide error
lnet: increase lnet transaction timeout
lnet: Avoid lnet debugfs read/write if ctl_table does not exist
lnet: check if current->nsproxy is NULL before using
Swapnil Pimpale (1):
lustre: lustre: Reserve OST_FALLOCATE(fallocate) opcode
Tatsushi Takamura (1):
lnet: handling device failure by IB event handler
Teddy Chan (1):
lustre: ptlrpc: Add QoS for uid and gid in NRS-TBF
Teddy Zheng (2):
lustre: hsm: add OBD_CONNECT2_ARCHIVE_ID_ARRAY to pass archive_id
lists in array
lustre: hsm: increase upper limit of maximum HSM backends registered
with MDT
Vitaly Fertman (6):
lustre: ptlrpc: Add more flags to DEBUG_REQ_FLAGS macro
lustre: ldlm: layout lock fixes
lustre: osc: layout and chunkbits alignment mismatch
lustre: osc: wrong cache of LVB attrs
lustre: osc: wrong cache of LVB attrs, part2
lustre: ldlm: fix lock convert races
Vladimir Saveliev (6):
lustre: obdclass: make mod rpc slot wait queue FIFO
lustre: lov: fix lov_iocontrol for inactive OST case
lnet: libcfs: do not calculate debug_mb if it is set
lustre: llite: improve ll_dom_lock_cancel
lustre: lov: check all entries in lov_flush_composite
lustre: lmv: disable statahead for remote objects
Wang Shilong (24):
lustre: llite: fix setstripe for specific osts upon dir
lnet: libcfs: fix wrong check in libcfs_debug_vmsg2()
lustre: quota: fix setattr project check
lustre: llite: make sure name pack atomic
lustre: ptlrpc: handle proper import states for recovery
lustre: llite: switch to use ll_fsname directly
lustre: llite: fill copied dentry name's ending char properly
lustre: llite, readahead: fix to call ll_ras_enter() properly
lnet: libcfs: fix panic for too large cpu partitions
lustre: lov: fix wrong calculated length for fiemap
lustre: push rcu_barrier() before destroying slab
lustre: llite,readahead: don't always use max RPC size
lustre: llite: improve single-thread read performance
lustre: llite: fix deadloop with tiny write
lustre: llite: make sure readahead cover current read
lustre: llite: don't check vmpage refcount in ll_releasepage()
lustre: osc: reserve lru pages for read in batch
lustre: llite: don't miss every first stride page
lustre: llite: extend readahead locks for striped file
lustre: readahead: convert stride page index to byte
lnet: eliminate uninitialized warning
lustre: llite: support page unaligned stride readahead
lustre: ptlrpc: always reset generation for idle reconnect
lustre: lmv: fix to return correct MDT count
Yang Sheng (6):
lustre: ldlm: speed up preparation for list of lock cancel
lustre: ldlm: fix for l_lru usage
lustre: class: use INIT_LIST_HEAD_RCU instead INIT_LIST_HEAD
lustre: lov: cl_cache could miss initialize
lustre: lov: remove KEY_CACHE_SET to simplify the code
lustre: import: fix race between imp_state & imp_invalid
fs/lustre/Kconfig | 5 + fs/lustre/fid/fid_request.c | 7 + fs/lustre/fld/fld_cache.c | 15 +- fs/lustre/fld/fld_internal.h | 1 - fs/lustre/fld/fld_request.c | 23 +- fs/lustre/include/cl_object.h | 73 +- fs/lustre/include/lprocfs_status.h | 33 +- fs/lustre/include/lu_object.h | 238 +- fs/lustre/include/lustre_disk.h | 1 + fs/lustre/include/lustre_dlm.h | 155 +- fs/lustre/include/lustre_dlm_flags.h | 33 +- fs/lustre/include/lustre_export.h | 29 +- fs/lustre/include/lustre_ha.h | 2 +- fs/lustre/include/lustre_handles.h | 21 +- fs/lustre/include/lustre_import.h | 45 +- fs/lustre/include/lustre_lmv.h | 82 +- fs/lustre/include/lustre_log.h | 4 +- fs/lustre/include/lustre_mdc.h | 120 - fs/lustre/include/lustre_net.h | 159 +- fs/lustre/include/lustre_osc.h | 27 +- fs/lustre/include/lustre_req_layout.h | 15 +- fs/lustre/include/lustre_sec.h | 12 + fs/lustre/include/lustre_swab.h | 2 + fs/lustre/include/obd.h | 151 +- fs/lustre/include/obd_cksum.h | 130 +- fs/lustre/include/obd_class.h | 150 +- fs/lustre/include/obd_support.h | 59 +- fs/lustre/ldlm/ldlm_extent.c | 2 +- fs/lustre/ldlm/ldlm_inodebits.c | 111 +- fs/lustre/ldlm/ldlm_internal.h | 42 +- fs/lustre/ldlm/ldlm_lib.c | 59 +- fs/lustre/ldlm/ldlm_lock.c | 359 +-- fs/lustre/ldlm/ldlm_lockd.c | 224 +- fs/lustre/ldlm/ldlm_pool.c | 28 +- fs/lustre/ldlm/ldlm_request.c | 444 +++- fs/lustre/ldlm/ldlm_resource.c | 196 +- fs/lustre/llite/Makefile | 2 +- fs/lustre/llite/dcache.c | 1 - fs/lustre/llite/dir.c | 731 ++++-- fs/lustre/llite/file.c | 987 ++++++-- fs/lustre/llite/glimpse.c | 1 + fs/lustre/llite/lcommon_cl.c | 35 +- fs/lustre/llite/lcommon_misc.c | 47 +- fs/lustre/llite/llite_internal.h | 444 +++- fs/lustre/llite/llite_lib.c | 719 ++++-- fs/lustre/llite/llite_mmap.c | 63 +- fs/lustre/llite/llite_nfs.c | 59 +- fs/lustre/llite/lproc_llite.c | 465 +++- fs/lustre/llite/namei.c | 717 ++++-- fs/lustre/llite/pcc.c | 2614 ++++++++++++++++++++ fs/lustre/llite/pcc.h | 264 ++ fs/lustre/llite/rw.c | 1091 ++++++--- fs/lustre/llite/rw26.c | 4 - fs/lustre/llite/statahead.c | 182 +- fs/lustre/llite/super25.c | 23 +- fs/lustre/llite/symlink.c | 21 +- fs/lustre/llite/vvp_dev.c | 1 + fs/lustre/llite/vvp_internal.h | 22 +- fs/lustre/llite/vvp_io.c | 176 +- fs/lustre/llite/vvp_object.c | 11 +- fs/lustre/llite/vvp_page.c | 19 +- fs/lustre/llite/xattr.c | 109 +- fs/lustre/llite/xattr_security.c | 19 + fs/lustre/lmv/lmv_fld.c | 17 +- fs/lustre/lmv/lmv_intent.c | 201 +- fs/lustre/lmv/lmv_internal.h | 162 +- fs/lustre/lmv/lmv_obd.c | 2078 +++++++++------- fs/lustre/lmv/lproc_lmv.c | 143 +- fs/lustre/lov/Makefile | 2 +- fs/lustre/lov/lov_cl_internal.h | 28 +- fs/lustre/lov/lov_ea.c | 117 +- fs/lustre/lov/lov_internal.h | 49 +- fs/lustre/lov/lov_io.c | 89 +- fs/lustre/lov/lov_obd.c | 162 +- fs/lustre/lov/lov_object.c | 159 +- fs/lustre/lov/lov_offset.c | 2 + fs/lustre/lov/lov_pack.c | 73 +- fs/lustre/lov/lov_page.c | 17 +- fs/lustre/lov/lov_pool.c | 19 +- fs/lustre/lov/lov_request.c | 29 +- fs/lustre/lov/lovsub_page.c | 68 - fs/lustre/lov/lproc_lov.c | 4 +- fs/lustre/mdc/lproc_mdc.c | 87 +- fs/lustre/mdc/mdc_changelog.c | 154 +- fs/lustre/mdc/mdc_dev.c | 171 +- fs/lustre/mdc/mdc_internal.h | 14 +- fs/lustre/mdc/mdc_lib.c | 86 +- fs/lustre/mdc/mdc_locks.c | 277 ++- fs/lustre/mdc/mdc_reint.c | 106 +- fs/lustre/mdc/mdc_request.c | 476 +++- fs/lustre/mgc/lproc_mgc.c | 12 +- fs/lustre/mgc/mgc_request.c | 86 +- fs/lustre/obdclass/Makefile | 2 +- fs/lustre/obdclass/cl_io.c | 49 +- fs/lustre/obdclass/cl_object.c | 23 +- fs/lustre/obdclass/cl_page.c | 36 +- fs/lustre/obdclass/class_obd.c | 151 +- fs/lustre/obdclass/genops.c | 139 +- fs/lustre/obdclass/integrity.c | 273 +++ fs/lustre/obdclass/jobid.c | 282 ++- fs/lustre/obdclass/llog.c | 126 +- fs/lustre/obdclass/llog_cat.c | 59 +- fs/lustre/obdclass/llog_internal.h | 4 +- fs/lustre/obdclass/lprocfs_status.c | 277 ++- fs/lustre/obdclass/lu_object.c | 518 +++- fs/lustre/obdclass/lu_tgt_descs.c | 682 ++++++ fs/lustre/obdclass/lustre_handles.c | 61 +- fs/lustre/obdclass/obd_cksum.c | 151 ++ fs/lustre/obdclass/obd_config.c | 39 +- fs/lustre/obdclass/obd_mount.c | 23 +- fs/lustre/obdclass/obd_sysfs.c | 101 +- fs/lustre/obdclass/obdo.c | 7 +- fs/lustre/obdecho/echo_client.c | 77 +- fs/lustre/osc/lproc_osc.c | 232 +- fs/lustre/osc/osc_cache.c | 172 +- fs/lustre/osc/osc_dev.c | 19 +- fs/lustre/osc/osc_internal.h | 48 +- fs/lustre/osc/osc_io.c | 115 +- fs/lustre/osc/osc_lock.c | 156 +- fs/lustre/osc/osc_object.c | 28 +- fs/lustre/osc/osc_page.c | 20 +- fs/lustre/osc/osc_quota.c | 18 +- fs/lustre/osc/osc_request.c | 619 +++-- fs/lustre/ptlrpc/client.c | 282 ++- fs/lustre/ptlrpc/errno.c | 27 + fs/lustre/ptlrpc/events.c | 12 +- fs/lustre/ptlrpc/import.c | 507 ++-- fs/lustre/ptlrpc/layout.c | 172 +- fs/lustre/ptlrpc/llog_client.c | 15 +- fs/lustre/ptlrpc/lproc_ptlrpc.c | 66 +- fs/lustre/ptlrpc/niobuf.c | 102 +- fs/lustre/ptlrpc/pack_generic.c | 236 +- fs/lustre/ptlrpc/pinger.c | 50 +- fs/lustre/ptlrpc/ptlrpc_internal.h | 3 +- fs/lustre/ptlrpc/ptlrpcd.c | 21 +- fs/lustre/ptlrpc/recover.c | 23 +- fs/lustre/ptlrpc/sec.c | 146 +- fs/lustre/ptlrpc/sec_bulk.c | 71 +- fs/lustre/ptlrpc/sec_config.c | 89 +- fs/lustre/ptlrpc/sec_gc.c | 16 +- fs/lustre/ptlrpc/sec_lproc.c | 74 + fs/lustre/ptlrpc/sec_null.c | 16 +- fs/lustre/ptlrpc/sec_plain.c | 7 +- fs/lustre/ptlrpc/service.c | 427 ++-- fs/lustre/ptlrpc/wiretest.c | 342 ++- include/linux/libcfs/libcfs.h | 1 + include/linux/libcfs/libcfs_debug.h | 69 +- include/linux/libcfs/libcfs_fail.h | 46 +- include/linux/lnet/api.h | 34 +- include/linux/lnet/lib-lnet.h | 225 +- include/linux/lnet/lib-types.h | 355 ++- include/uapi/linux/lnet/libcfs_debug.h | 4 +- include/uapi/linux/lnet/libcfs_ioctl.h | 13 +- include/uapi/linux/lnet/lnet-dlc.h | 42 + include/uapi/linux/lnet/lnet-types.h | 49 +- include/uapi/linux/lnet/lnetctl.h | 23 + include/uapi/linux/lnet/nidstr.h | 2 + include/uapi/linux/lustre/lustre_cfg.h | 1 + include/uapi/linux/lustre/lustre_fid.h | 7 + include/uapi/linux/lustre/lustre_idl.h | 392 +-- include/uapi/linux/lustre/lustre_ioctl.h | 5 +- include/uapi/linux/lustre/lustre_kernelcomm.h | 15 +- include/uapi/linux/lustre/lustre_user.h | 575 +++-- include/uapi/linux/lustre/lustre_ver.h | 6 +- mm/page-writeback.c | 1 + net/lnet/klnds/o2iblnd/o2iblnd.c | 357 ++- net/lnet/klnds/o2iblnd/o2iblnd.h | 63 +- net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 169 +- net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 30 +- net/lnet/klnds/socklnd/socklnd.c | 737 +++--- net/lnet/klnds/socklnd/socklnd.h | 95 +- net/lnet/klnds/socklnd/socklnd_cb.c | 139 +- net/lnet/klnds/socklnd/socklnd_proto.c | 24 +- net/lnet/libcfs/debug.c | 5 +- net/lnet/libcfs/fail.c | 15 +- net/lnet/libcfs/libcfs_cpu.c | 11 +- net/lnet/libcfs/libcfs_lock.c | 2 +- net/lnet/libcfs/linux-crypto.c | 5 +- net/lnet/libcfs/module.c | 33 +- net/lnet/libcfs/tracefile.c | 50 +- net/lnet/lnet/acceptor.c | 27 +- net/lnet/lnet/api-ni.c | 828 +++++-- net/lnet/lnet/config.c | 57 +- net/lnet/lnet/lib-eq.c | 4 +- net/lnet/lnet/lib-md.c | 23 +- net/lnet/lnet/lib-me.c | 135 +- net/lnet/lnet/lib-move.c | 3266 +++++++++++++++++++------ net/lnet/lnet/lib-msg.c | 711 +++++- net/lnet/lnet/lib-ptl.c | 2 +- net/lnet/lnet/lib-socket.c | 17 +- net/lnet/lnet/lo.c | 1 - net/lnet/lnet/module.c | 8 +- net/lnet/lnet/net_fault.c | 126 +- net/lnet/lnet/nidstrings.c | 272 +- net/lnet/lnet/peer.c | 725 ++++-- net/lnet/lnet/router.c | 1613 ++++++------ net/lnet/lnet/router_proc.c | 212 +- net/lnet/selftest/conctl.c | 4 +- net/lnet/selftest/console.c | 10 +- net/lnet/selftest/framework.c | 28 +- net/lnet/selftest/module.c | 2 +- net/lnet/selftest/rpc.c | 43 +- net/lnet/selftest/rpc.h | 10 +- 203 files changed, 25222 insertions(+), 10485 deletions(-) create mode 100644 fs/lustre/llite/pcc.c create mode 100644 fs/lustre/llite/pcc.h delete mode 100644 fs/lustre/lov/lovsub_page.c create mode 100644 fs/lustre/obdclass/integrity.c create mode 100644 fs/lustre/obdclass/lu_tgt_descs.c create mode 100644 fs/lustre/obdclass/obd_cksum.c
Signature · 1 line
1.8.3.1
PATCH 1/622 lustre: always enable special debugging, fhandles, and quota support.
Lustre heavily depends on fhandles for its FID handling and needs quota always enabled.
--- fs/lustre/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
fs/lustre/Kconfig +4 -0
@@ -9,6 +9,9 @@ config LUSTRE_FS select CRYPTO_SHA1 select CRYPTO_SHA256 select CRYPTO_SHA512 + select DEBUG_FS + select FHANDLE + select QUOTA depends on MULTIUSER help This option enables Lustre file system client support. Choose Y
@@ -43,6 +46,7 @@ config LUSTRE_FS_POSIX_ACL config LUSTRE_DEBUG_EXPENSIVE_CHECK bool "Enable Lustre DEBUG checks" + select REFCOUNT_FULL depends on LUSTRE_FS help This option is mainly for debug purpose. It enables Lustre code to do
Signature · 1 line
1.8.3.1
PATCH 2/622 lustre: osc_cache: remove __might_sleep()
In reply to James SimmonsThe patch 'simplify osc_wake_cache_waiters()' created a new wrapper wait_event_idle_exclusive_timeout_cmd() which includes a __might_sleep() test. This was causing the following back trace:
kernel: BUG: sleeping function called from invalid context at fs/lustre/osc/osc_cache.c:1635
kernel: in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 19374, name: cp
kernel: INFO: lockdep is turned off.
kernel: Preemption disabled at:
kernel: [<0000000000000000>] 0x0
kernel: CPU: 11 PID: 19374 Comm: cp Tainted: G W 5.4.0-rc5+ #1
kernel: Call Trace:
kernel: dump_stack+0x5e/0x8b
kernel: ___might_sleep+0x205/0x260
kernel: osc_queue_async_io+0x1104/0x1de0 [osc]
kernel: ? _raw_spin_unlock+0x2e/0x50
kernel: ? libcfs_debug_msg+0x6ab/0xc80 [libcfs]
kernel: ? vvp_io_setattr_start+0x200/0x200 [lustre]
kernel: osc_page_cache_add+0x2c/0xa0 [osc]
kernel: osc_io_commit_async+0x1a8/0x420 [osc]
kernel: cl_io_commit_async+0x58/0x80 [obdclass]
kernel: ? vvp_io_setattr_start+0x200/0x200 [lustre:1
This can be called from an atomic context and examing the code suggest we don't need __might_sleep() so lets remove it.
--- fs/lustre/osc/osc_cache.c | 1 - 1 file changed, 1 deletion(-)
fs/lustre/osc/osc_cache.c +0 -1
@@ -1570,7 +1570,6 @@ static bool osc_enter_cache_try(struct client_obd *cli, cmd1, cmd2) \ ({ \ long __ret = timeout; \ - might_sleep(); \ if (!___wait_cond_timeout(condition)) \ __ret = __wait_event_idle_exclusive_timeout_cmd( \ wq_head, condition, timeout, cmd1, cmd2); \
Signature · 1 line
1.8.3.1
PATCH 3/622 lustre: uapi: remove enum hsm_progress_states
In reply to James SimmonsThis enum is used only by server side code.
--- include/uapi/linux/lustre/lustre_user.h | 21 --------------------- 1 file changed, 21 deletions(-)
include/uapi/linux/lustre/lustre_user.h +0 -21
@@ -1532,27 +1532,6 @@ enum hsm_states {*/ #define HSM_FLAGS_MASK (HSM_USER_MASK | HSM_STATUS_MASK) -/** -* HSM??request progress state -*/ -enum hsm_progress_states { -HPS_WAITING =1 , -HPS_RUNNING =2 , -HPS_DONE =3 , -}; - -#define HPS_NONE 0 - -static inline const char *hsm_progress_state2name (enum hsm_progress_states s) -{ -switch (s) { -case HPS_WAITING :return "waiting" ; -case HPS_RUNNING :return "running" ; -case HPS_DONE :return "done" ; -default :return "unknown" ; - } -} -struct hsm_extent {__u64 offset;__u64 length;
Signature · 1 line
1.8.3.1
PATCH 4/622 lustre: uapi: sync enum obd_statfs_state
In reply to James SimmonsWith the drift between the OpenSFS and linux client various enum obd_statfs_state values where dropped that are transmitted over the wire. Sync the values.
--- include/uapi/linux/lustre/lustre_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/uapi/linux/lustre/lustre_user.h +3 -3
@@ -101,9 +101,9 @@enum obd_statfs_state {OS_STATE_DEGRADED =0x00000001 ,/**< RAID degraded/rebuilding */ OS_STATE_READONLY =0x00000002 ,/**< filesystem is read-only */ -OS_STATE_RDONLY_1 =0x00000004 ,/**< obsolete 1.6, was EROFS=30 */ -OS_STATE_RDONLY_2 =0x00000008 ,/**< obsolete 1.6, was EROFS=30 */ -OS_STATE_RDONLY_3 =0x00000010 ,/**< obsolete 1.6, was EROFS=30 */ +OS_STATE_NOPRECREATE =0x00000004 ,/**< no object precreation */ +OS_STATE_ENOSPC =0x00000020 ,/**< not enough free space */ +OS_STATE_ENOINO =0x00000040 ,/**< not enough inodes */ };struct obd_statfs {
Signature · 1 line
1.8.3.1
PATCH 5/622 lustre: llite: return compatible fsid for statfs
In reply to James SimmonsFrom: Fan Yong <[email protected]>
Lustre uses 64-bits inode number to identify object on client side. When re-export Lustre via NFS, NFS will detect whether support fsid via statfs(). For the non-support case, it will only recognizes and packs low 32-bits inode number in nfs handle. Such handle cannot be used to locate the object properly.
To avoid patch linux kernel, Lustre client should generate fsid and return it via statfs() to up layer.
To be compatible with old Lustre client (NFS server), the fsid will be generated from super_block::s_dev.
WC-bug-id: https://jira.whamcloud.com/browse/LU-2904
Lustre-commit: abe4d83fab00 ("LU-2904 llite: return compatible fsid for statfs")
Reviewed-on: http://review.whamcloud.com/7434
--- fs/lustre/llite/llite_internal.h | 3 --- fs/lustre/llite/llite_lib.c | 8 ++++---- fs/lustre/llite/llite_nfs.c | 16 ---------------- 3 files changed, 4 insertions(+), 23 deletions(-)
fs/lustre/llite/llite_internal.h +0 -3
@@ -538,8 +538,6 @@ struct ll_sb_info {/* st_blksize returned by stat(2), when non-zero */ unsigned int ll_stat_blksize; -__kernel_fsid_t ll_fsid; -struct kset ll_kset;/* sysfs object */ struct completion ll_kobj_unregister; };
@@ -941,7 +939,6 @@ static inline ssize_t ll_lov_user_md_size(const struct lov_user_md *lum)/* llite/llite_nfs.c */ extern const struct export_operations lustre_export_operations;u32 get_uuid2int (const char *name,int len); -void get_uuid2fsid (const char *name,int len,__kernel_fsid_t *fsid);struct inode *search_inode_for_lustre (struct super_block *sb,const struct lu_fid *fid);int ll_dir_get_parent_fid (struct inode *dir,struct lu_fid *parent_fid);
fs/lustre/llite/llite_lib.c +4 -4
@@ -591,10 +591,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)* only a node-local comparison. */ uuid =obd_get_uuid (sbi->ll_md_exp); -if (uuid) { +if (uuid) sb->s_dev =get_uuid2int (uuid->uuid,strlen (uuid->uuid)); -get_uuid2fsid (uuid->uuid,strlen (uuid->uuid), &sbi->ll_fsid); - }kfree (data);kfree (osfs);
@@ -1775,6 +1773,7 @@ int ll_statfs(struct dentry *de, struct kstatfs *sfs) {struct super_block *sb = de->d_sb;struct obd_statfs osfs; +u64 fsid =huge_encode_dev (sb->s_dev);int rc;CDEBUG (D_VFSTRACE ,"VFS Op: at %llu jiffies\n" ,get_jiffies_64 ());
@@ -1805,7 +1804,8 @@ int ll_statfs(struct dentry *de, struct kstatfs *sfs) sfs->f_blocks = osfs.os_blocks; sfs->f_bfree = osfs.os_bfree; sfs->f_bavail = osfs.os_bavail; - sfs->f_fsid =ll_s2sbi (sb)->ll_fsid; + sfs->f_fsid.val[0 ] = (u32 )fsid; + sfs->f_fsid.val[1 ] = (u32)(fsid >>32 );return 0 ; }
fs/lustre/llite/llite_nfs.c +0 -16
@@ -57,22 +57,6 @@ u32 get_uuid2int(const char *name, int len)return (key0 <<1 ); } -void get_uuid2fsid (const char *name,int len,__kernel_fsid_t *fsid) -{ -u64 key =0 , key0 =0x12a3fe2d , key1 =0x37abe8f9 ; - -while (len--) { - key = key1 + (key0 ^ (*name++ *7152373 )); -if (key &0x8000000000000000ULL ) - key -=0x7fffffffffffffffULL ; - key1 = key0; - key0 = key; - } - - fsid->val[0 ] = key; - fsid->val[1 ] = key >>32 ; -} -struct inode *search_inode_for_lustre (struct super_block *sb,const struct lu_fid *fid) {
Signature · 1 line
1.8.3.1
PATCH 6/622 lustre: ldlm: Make kvzalloc | kvfree use consistent
In reply to James SimmonsFrom: "Christopher J. Morrone" <[email protected]>
struct ldlm_lock's l_lvb_data field is freed in ldlm_lock_put() using kfree. However, some other code paths can attach a buffer to l_lvb_data that was allocated using vmalloc(). This can lead to a kfree() of a vmalloc()ed buffer, which can trigger a kernel Oops.
WC-bug-id: https://jira.whamcloud.com/browse/LU-4194
Lustre-commit: 9c4d506c5fea ("LU-4194 ldlm: Make OBD_[ALLOC|FREE]_LARGE use consistent")
Reviewed-on: http://review.whamcloud.com/8298
--- fs/lustre/ldlm/ldlm_lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/lustre/ldlm/ldlm_lock.c +2 -2
@@ -185,7 +185,7 @@ void ldlm_lock_put(struct ldlm_lock *lock) lock->l_export =NULL ; } -kfree (lock->l_lvb_data); +kvfree (lock->l_lvb_data);lu_ref_fini (&lock->l_reference);OBD_FREE_RCU (lock,sizeof (*lock), &lock->l_handle);
@@ -1548,7 +1548,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,if (lvb_len) { lock->l_lvb_len = lvb_len; - lock->l_lvb_data =kzalloc (lvb_len,GFP_NOFS ); + lock->l_lvb_data =kvzalloc (lvb_len,GFP_NOFS );if (!lock->l_lvb_data) { rc = -ENOMEM ; goto out;
Signature · 1 line
1.8.3.1
PATCH 7/622 lustre: llite: limit smallest max_cached_mb value
In reply to James SimmonsFrom: James Nunez <[email protected]>
Currently, ost-survey hangs due to calling 'lfs setstripe' in an old (positional) style and setting max_cached_mb to zero.
In ll_max_cached_mb_seq_write(), the number of pages requested is set to the max of pages requested or PTLRPC_MAX_BRW_PAGES to allow the client to make well formed RPCs.
WC-bug-id: https://jira.whamcloud.com/browse/LU-4768
Lustre-commit: 46bec835ac72 ("LU-4768 tests: Update ost-survey script")
Reviewed-on: http://review.whamcloud.com/11971
--- fs/lustre/llite/lproc_llite.c | 2 ++ 1 file changed, 2 insertions(+)
fs/lustre/llite/lproc_llite.c +2 -0
@@ -527,6 +527,8 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, totalram_pages() >> (20 - PAGE_SHIFT));return -ERANGE ; } +/* Allow enough cache so clients can make well-formed RPCs */ + pages_number =max_t (long, pages_number,PTLRPC_MAX_BRW_PAGES );spin_lock (&sbi->ll_lock); diff = pages_number - cache->ccc_lru_max;
Signature · 1 line
1.8.3.1
PATCH 8/622 lustre: obdecho: turn on async flag only for mode 3
In reply to James SimmonsFrom: Rahul Deshmukh <[email protected]>
There are couple of problems in obdfilter-survey:
- Type of test brw i.e. "g" was not followed with npages,
- Target netdisk was not set properly and
- Turn ON async flag only for mode 3.
This patch fixes the last problem which is kernel side.
WC-bug-id: https://jira.whamcloud.com/browse/LU-5031
Lustre-commit: 9f38647a7b24 ("LU-5031 tests: obdfilter-survey fixes")
Reviewed-on: http://review.whamcloud.com/10264
--- fs/lustre/obdecho/echo_client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/lustre/obdecho/echo_client.c +4 -4
@@ -1425,7 +1425,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,struct obdo *oa = &data->ioc_obdo1;struct echo_object *eco;int rc; -int async =1 ; +int async =0 ;long test_mode;LASSERT (oa->o_valid &OBD_MD_FLGROUP );
@@ -1438,14 +1438,14 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,/* OFD/obdfilter works only via prep/commit */ test_mode = (long )data->ioc_pbuf1; -if (test_mode ==1 ) - async =0 ; -if (!ed->ed_next && test_mode !=3 ) { test_mode =3 ; data->ioc_plen1 = data->ioc_count; } +if (test_mode ==3 ) + async =1 ; +/* Truncate batch size to maximum */ if (data->ioc_plen1 >PTLRPC_MAX_BRW_SIZE ) data->ioc_plen1 =PTLRPC_MAX_BRW_SIZE ;
Signature · 1 line
1.8.3.1
PATCH 9/622 lustre: llite: reorganize variable and data structures
In reply to James SimmonsFrom: "John L. Hammond" <[email protected]>
This patch covers the bits missed in the patch series "Lustre IO stack simplifications and cleanups" from the OpenSFS branch for the LU-5971 work. Details of the original push can be viewed at https://lore.kernel.org/patchwork/cover/662900.
No Fixed is provided since the staging patch series was broken up into a much larger patch set.
WC-bug-id: https://jira.whamcloud.com/browse/LU-5971
Lustre-commit: 6eda93c7b5f6 ("LU-5971 llite: reorganize variable and data structures")
Reviewed-on: http://review.whamcloud.com/13714
--- fs/lustre/llite/file.c | 1 + fs/lustre/llite/glimpse.c | 1 + fs/lustre/llite/lcommon_cl.c | 5 ++--- fs/lustre/llite/lcommon_misc.c | 24 ++++++++++++------------ fs/lustre/llite/llite_internal.h | 8 ++++---- fs/lustre/llite/llite_lib.c | 4 ++-- fs/lustre/llite/super25.c | 1 + fs/lustre/llite/vvp_dev.c | 1 + fs/lustre/llite/vvp_internal.h | 13 +++---------- fs/lustre/llite/vvp_io.c | 4 ++-- 10 files changed, 29 insertions(+), 33 deletions(-)
fs/lustre/llite/file.c +1 -0
@@ -49,6 +49,7 @@#include <cl_object.h> #include "llite_internal.h" +#include "vvp_internal.h" struct split_param {struct inode *sp_inode;
fs/lustre/llite/glimpse.c +1 -0
@@ -47,6 +47,7 @@#include <cl_object.h> #include "llite_internal.h" +#include "vvp_internal.h" static const struct cl_lock_descr whole_file = { .cld_start =0 ,
fs/lustre/llite/lcommon_cl.c +2 -3
@@ -30,8 +30,6 @@* This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * -* cl code used by vvp (and other Lustre clients in the future). -* * Author: Nikita Danilov <[email protected]> */
@@ -63,6 +61,7 @@* Vvp device and device type functions. * */ +#include "vvp_internal.h" /** * An `emergency' environment used by cl_inode_fini() when cl_env_get()
@@ -282,7 +281,7 @@ u64 cl_fid_build_ino(const struct lu_fid *fid, bool api32)return fid_flatten (fid); } -/** +/* * build inode generation from passed @fid. If our FID overflows the 32-bit * inode number then return a non-zero generation to distinguish them. */
fs/lustre/llite/lcommon_misc.c +12 -12
@@ -46,7 +46,7 @@* maximum-sized (= maximum striped) EA and cookie without having to * calculate this (via a call into the LOV + OSCs) each time we make an RPC. */ -int cl_init_ea_size (struct obd_export *md_exp,struct obd_export *dt_exp) +static int cl_init_ea_size (struct obd_export *md_exp,struct obd_export *dt_exp) {u32 val_size, max_easize, def_easize;int rc;
@@ -115,7 +115,7 @@ int cl_ocd_update(struct obd_device *host, struct obd_device *watched,#define GROUPLOCK_SCOPE "grouplock"int cl_get_grouplock (struct cl_object *obj,unsigned long gid,int nonblock, -struct ll_grouplock *cg) +struct ll_grouplock *lg) {struct lu_env *env;struct cl_io *io;
@@ -160,22 +160,22 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,return rc; } - cg->lg_env = env; - cg->lg_io = io; - cg->lg_lock = lock; - cg->lg_gid = gid; + lg->lg_env = env; + lg->lg_io = io; + lg->lg_lock = lock; + lg->lg_gid = gid;return 0 ; } -void cl_put_grouplock (struct ll_grouplock *cg) +void cl_put_grouplock (struct ll_grouplock *lg) { -struct lu_env *env = cg->lg_env; -struct cl_io *io = cg->lg_io; -struct cl_lock *lock = cg->lg_lock; +struct lu_env *env = lg->lg_env; +struct cl_io *io = lg->lg_io; +struct cl_lock *lock = lg->lg_lock; -LASSERT (cg->lg_env); -LASSERT (cg->lg_gid); +LASSERT (lg->lg_env); +LASSERT (lg->lg_gid);cl_lock_release (env, lock);cl_io_fini (env, io);
fs/lustre/llite/llite_internal.h +4 -4
@@ -707,7 +707,6 @@ static inline bool ll_sbi_has_tiny_write(struct ll_sb_info *sbi)void ll_ras_enter (struct file *f);/* llite/lcommon_misc.c */ -int cl_init_ea_size (struct obd_export *md_exp,struct obd_export *dt_exp);int cl_ocd_update (struct obd_device *host,struct obd_device *watched,enum obd_notify_event ev,void *owner); int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
@@ -975,9 +974,9 @@ struct ll_cl_context {struct ll_thread_info {struct iov_iter lti_iter; -struct vvp_io_args lti_args; -struct ra_io_arg lti_ria; -struct ll_cl_context lti_io_ctx; +struct vvp_io_args lti_args; +struct ra_io_arg lti_ria; +struct ll_cl_context lti_io_ctx; };extern struct lu_context_key ll_thread_key;
@@ -1165,6 +1164,7 @@ struct ll_statahead_info {blkcnt_t dirty_cnt (struct inode *inode);int __cl_glimpse_size (struct inode *inode,int agl); +int cl_glimpse_lock (const struct lu_env *env,struct cl_io *io,struct inode *inode,struct cl_object *clob,int agl);
fs/lustre/llite/llite_lib.c +2 -2
@@ -2542,7 +2542,7 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret) {char *buf, *path =NULL ;struct dentry *dentry =NULL ; -struct vvp_object *obj =cl_inode2vvp (page->mapping->host); +struct inode *inode = page->mapping->host;/* this can be called inside spin lock so use GFP_ATOMIC. */ buf = (char *)__get_free_page (GFP_ATOMIC );
@@ -2556,7 +2556,7 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret)"%s: dirty page discard: %s/fid: " DFID "/%s may get corrupted (rc %d)\n" ,ll_get_fsname (page->mapping->host->i_sb,NULL ,0 ),s2lsi (page->mapping->host->i_sb)->lsi_lmd->lmd_dev, -PFID (&obj->vob_header.coh_lu.loh_fid), +PFID (ll_inode2fid (inode)), (path && !IS_ERR(path)) ? path : "", ioret);if (dentry)
fs/lustre/llite/super25.c +1 -0
@@ -42,6 +42,7 @@#include <linux/fs.h> #include <lprocfs_status.h> #include "llite_internal.h" +#include "vvp_internal.h" static struct kmem_cache *ll_inode_cachep;
fs/lustre/llite/vvp_dev.c +1 -0
@@ -93,6 +93,7 @@ static void *ll_thread_key_init(const struct lu_context *ctx, info =kmem_cache_zalloc (ll_thread_kmem,GFP_NOFS );if (!info) info =ERR_PTR (-ENOMEM ); +return info; }
fs/lustre/llite/vvp_internal.h +3 -10
@@ -166,7 +166,7 @@ static inline struct cl_io *vvp_env_thread_io(const struct lu_env *env) }struct vvp_session { -struct vvp_io cs_ios; +struct vvp_io vs_ios; };static inline struct vvp_session *vvp_env_session (const struct lu_env *env)
@@ -181,11 +181,11 @@ static inline struct vvp_session *vvp_env_session(const struct lu_env *env)static inline struct vvp_io *vvp_env_io (const struct lu_env *env) { -return &vvp_env_session (env)->cs_ios; +return &vvp_env_session (env)->vs_ios; }/** -* ccc-private object state. +* VPP-private object state. */ struct vvp_object {struct cl_object_header vob_header;
@@ -246,13 +246,6 @@ struct vvp_device {struct cl_device *vdv_next; }; -void *ccc_key_init (const struct lu_context *ctx, -struct lu_context_key *key); -void ccc_key_fini (const struct lu_context *ctx, -struct lu_context_key *key,void *data); - -void ccc_umount (const struct lu_env *env,struct cl_device *dev); -static inline struct lu_device *vvp2lu_dev (struct vvp_device *vdv) {return &vdv->vdv_cl.cd_lu_dev;
fs/lustre/llite/vvp_io.c +2 -2
@@ -416,10 +416,10 @@ static enum cl_lock_mode vvp_mode_from_vma(struct vm_area_struct *vma)static int vvp_mmap_locks (const struct lu_env *env,struct vvp_io *vio,struct cl_io *io) { -struct vvp_thread_info *cti =vvp_env_info (env); +struct vvp_thread_info *vti =vvp_env_info (env);struct mm_struct *mm = current->mm;struct vm_area_struct *vma; -struct cl_lock_descr *descr = &cti->vti_descr; +struct cl_lock_descr *descr = &vti->vti_descr;union ldlm_policy_data policy;unsigned long addr;ssize_t count;
Signature · 1 line
1.8.3.1
PATCH 10/622 lustre: llite: increase whole-file readahead to RPC size
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Increase the default whole-file readahead limit to match the current RPC size. That ensures that files smaller than the RPC size will be read in a single round-trip instead of sending multiple smaller RPCs.
WC-bug-id: https://jira.whamcloud.com/browse/LU-7990
Lustre-commit: 627d0133d9d7 ("LU-7990 llite: increase whole-file readahead to RPC size")
Reviewed-on: https://review.whamcloud.com/26955
--- fs/lustre/llite/llite_lib.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/lustre/llite/llite_lib.c +6 -0
@@ -465,6 +465,12 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) sbi->ll_dt_exp->exp_connect_data = *data; +/* Don't change value if it was specified in the config log */ +if (sbi->ll_ra_info.ra_max_read_ahead_whole_pages ==-1 ) + sbi->ll_ra_info.ra_max_read_ahead_whole_pages = + max_t(unsigned long, SBI_DEFAULT_READAHEAD_WHOLE_MAX, + (data->ocd_brw_size >>PAGE_SHIFT )); + err =obd_fid_init (sbi->ll_dt_exp->exp_obd, sbi->ll_dt_exp,LUSTRE_SEQ_METADATA );if (err) {
Signature · 1 line
1.8.3.1
PATCH 11/622 lustre: llite: handle ORPHAN/DEAD directories
In reply to James SimmonsFrom: Di Wang <[email protected]>
Don't set the directory MDS striping if the parent is dead. To test this works add the OBD_FAIL_LLITE_NO_CHECK_DEAD injection fault.
WC-bug-id: https://jira.whamcloud.com/browse/LU-7579
Lustre-commit: 098fb363c39 ("LU-7579 osd: move ORPHAN/DEAD flag to OSD")
Reviewed-on: http://review.whamcloud.com/18024
--- fs/lustre/include/obd_support.h | 1 + fs/lustre/llite/dir.c | 4 ++++ 2 files changed, 5 insertions(+)
fs/lustre/include/obd_support.h +1 -0
@@ -442,6 +442,7 @@#define OBD_FAIL_LLITE_XATTR_ENOMEM 0x1405#define OBD_FAIL_MAKE_LOVEA_HOLE 0x1406#define OBD_FAIL_LLITE_LOST_LAYOUT 0x1407 +#define OBD_FAIL_LLITE_NO_CHECK_DEAD 0x1408#define OBD_FAIL_GETATTR_DELAY 0x1409#define OBD_FAIL_LLITE_CREATE_NODE_PAUSE 0x140c#define OBD_FAIL_LLITE_IMUTEX_SEC 0x140e
fs/lustre/llite/dir.c +4 -0
@@ -433,6 +433,10 @@ static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump, !(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_DIR_STRIPE))return -EINVAL ; +if (IS_DEADDIR (parent) && + !OBD_FAIL_CHECK (OBD_FAIL_LLITE_NO_CHECK_DEAD )) +return -ENOENT ; +if (lump->lum_magic !=cpu_to_le32 (LMV_USER_MAGIC ) && lump->lum_magic !=cpu_to_le32 (LMV_USER_MAGIC_SPECIFIC ))lustre_swab_lmv_user_md (lump);
Signature · 1 line
1.8.3.1
PATCH 12/622 lustre: lov: protected ost pool count updation
In reply to James SimmonsFrom: Jadhav Vikram <[email protected]>
ASSERTION(iter->lpi_idx <= ((iter->lpi_pool)->pool_obds.op_count) caused due to reading of ost pool count is not protected in pool_proc_next and pool_proc_show, pool_proc_show get called when op_count was zero.
Fix to protect ost pool count by taking lock at start sequence function pool_proc_start and released lock in pool_proc_stop. Rather than using down_read / up_read pairs around pool_proc_next and pool_proc_show, this changes make sure ost pool data gets protected throughout sequence operation.
Seagate-bug-id: MRP-3629
WC-bug-id: https://jira.whamcloud.com/browse/LU-9620
Lustre-commit: 61c803319b91 ("LU-9620 lod: protected ost pool count updation")
Reviewed-on: https://review.whamcloud.com/27506
--- fs/lustre/lov/lov_pool.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
fs/lustre/lov/lov_pool.c +3 -6
@@ -117,14 +117,11 @@ static void *pool_proc_next(struct seq_file *s, void *v, loff_t *pos)/* iterate to find a non empty entry */ prev_idx = iter->idx; -down_read (&pool_tgt_rw_sem (iter->pool)); iter->idx++; -if (iter->idx ==pool_tgt_count (iter->pool)) { +if (iter->idx >=pool_tgt_count (iter->pool)) { iter->idx = prev_idx;/* we stay on the last entry */ -up_read (&pool_tgt_rw_sem (iter->pool));return NULL ; } -up_read (&pool_tgt_rw_sem (iter->pool)); (*pos)++;/* return != NULL to continue */ return iter;
@@ -157,6 +154,7 @@ static void *pool_proc_start(struct seq_file *s, loff_t *pos)*/ /* /!\ do not forget to restore it to pool before freeing it */ s->private = iter; +down_read (&pool_tgt_rw_sem (pool));if (*pos >0 ) {loff_t i;void *ptr;
@@ -179,6 +177,7 @@ static void pool_proc_stop(struct seq_file *s, void *v)* we have to free only if s->private is an iterator */ if ((iter) && (iter->magic ==POOL_IT_MAGIC )) { +up_read (&pool_tgt_rw_sem (iter->pool));/* we restore s->private so next call to pool_proc_start() * will work */
@@ -197,9 +196,7 @@ static int pool_proc_show(struct seq_file *s, void *v)LASSERT (iter->pool);LASSERT (iter->idx <=pool_tgt_count (iter->pool)); -down_read (&pool_tgt_rw_sem (iter->pool)); tgt =pool_tgt (iter->pool, iter->idx); -up_read (&pool_tgt_rw_sem (iter->pool));if (tgt)seq_printf (s,"%s\n" ,obd_uuid2str (&tgt->ltd_uuid));
Signature · 1 line
1.8.3.1
PATCH 13/622 lustre: obdclass: fix llog_cat_cleanup() usage on Client
In reply to James SimmonsFrom: Bruno Faccini <[email protected]>
With patch/commit 3a83b4b9 for LU-5195, LLOG code has been strengthen against catalog inconsistency by detecting a referenced plain LLOG is missing and by clearing its associated entry by calling llog_cat_cleanup(), which now needs to handle the case where it is also executed on a Client (ie, cathandle->lgh_obj == NULL) and thus must not attempt to update on-disk catalog.
WC-bug-id: https://jira.whamcloud.com/browse/LU-6471
Lustre-commit: 485f3ba87433 ("LU-6471 obdclass: fix llog_cat_cleanup() usage on Client")
Reviewed-on: http://review.whamcloud.com/14489
--- fs/lustre/obdclass/llog_cat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/lustre/obdclass/llog_cat.c +2 -4
@@ -133,10 +133,8 @@ int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)list_del_init (&loghandle->u.phd.phd_entry);llog_close (env, loghandle); } -/* if handle was stored in ctxt, remove it too */ -if (cathandle->lgh_ctxt->loc_handle == cathandle) - cathandle->lgh_ctxt->loc_handle =NULL ; -return llog_close (env, cathandle); + +return 0 ; }EXPORT_SYMBOL (llog_cat_close);
Signature · 1 line
1.8.3.1
PATCH 14/622 lustre: mdc: fix possible NULL pointer dereference
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Fix two static analysis errors.
fs/lustre/mdc/mdc_dev.c: in mdc_enqueue_send(), pointer 'matched' return
from call to function 'ldlm_handle2lock' at line 704 may be NULL and will be dereferenced at line 705.
If client is evicted between ldlm_lock_match() and ldlm_handle2lock() the lock pointer could be NULL.
fs/lustre/lov/lov_dev.c:488 in lov_process_config, sscanf format
specification '%d' expects type 'int' for 'd', but parameter 3 has a different type '__u32'.
Converting to kstrtou32() requires changing the "index" variable type from __u32 to u32, which is fine since it is only used internally, fix up the few functions that are also passing "__u32 index" and the resulting checkpatch.pl warnings.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10264
Lustre-commit: b89206476174 ("LU-10264 mdc: fix possible NULL pointer dereference")
Reviewed-on: https://review.whamcloud.com/31621
--- fs/lustre/lov/lov_obd.c | 45 ++++++++++++++++++++++++--------------------- fs/lustre/mdc/mdc_dev.c | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-)
fs/lustre/lov/lov_obd.c +24 -21
@@ -312,7 +312,8 @@ static int lov_disconnect(struct obd_export *exp) {struct obd_device *obd =class_exp2obd (exp);struct lov_obd *lov = &obd->u.lov; -int i, rc; +u32 index; +int rc;if (!lov->lov_tgts) goto out;
@@ -321,19 +322,19 @@ static int lov_disconnect(struct obd_export *exp) lov->lov_connects--;if (lov->lov_connects !=0 ) {/* why should there be more than 1 connect? */ -CERROR ("disconnect #%d\n" , lov->lov_connects); +CWARN ("%s: unexpected disconnect #%d\n" , + obd->obd_name, lov->lov_connects); goto out; } -/* Let's hold another reference so lov_del_obd doesn't spin through -* putref every time -*/ +/* hold another ref so lov_del_obd() doesn't spin in putref each time */ lov_tgts_getref (obd); -for (i =0 ; i < lov->desc.ld_tgt_count; i++) { -if (lov->lov_tgts[i] && lov->lov_tgts[i]->ltd_exp) { -/* Disconnection is the last we know about an obd */ -lov_del_target (obd, i,NULL , lov->lov_tgts[i]->ltd_gen); +for (index =0 ; index < lov->desc.ld_tgt_count; index++) { +if (lov->lov_tgts[index] && lov->lov_tgts[index]->ltd_exp) { +/* Disconnection is the last we know about an OBD */ +lov_del_target (obd, index,NULL , + lov->lov_tgts[index]->ltd_gen); } }
@@ -490,13 +491,12 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp, uuidp->uuid, index, gen, active);if (gen <=0 ) { -CERROR ("request to add OBD %s with invalid generation: %d\n" , - uuidp->uuid, gen); +CERROR ("%s: request to add '%s' with invalid generation: %d\n" , + obd->obd_name, uuidp->uuid, gen);return -EINVAL ; } - tgt_obd =class_find_client_obd (uuidp,LUSTRE_OSC_NAME , - &obd->obd_uuid); + tgt_obd =class_find_client_obd (uuidp,LUSTRE_OSC_NAME , &obd->obd_uuid);if (!tgt_obd)return -EINVAL ;
@@ -504,10 +504,11 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,if ((index < lov->lov_tgt_size) && lov->lov_tgts[index]) { tgt = lov->lov_tgts[index]; -CERROR ("UUID %s already assigned at LOV target index %d\n" , -obd_uuid2str (&tgt->ltd_uuid), index); + rc = -EEXIST ; +CERROR ("%s: UUID %s already assigned at index %d: rc = %d\n" , + obd->obd_name,obd_uuid2str (&tgt->ltd_uuid), index, rc);mutex_unlock (&lov->lov_lock); -return -EEXIST ; +return rc; }if (index >= lov->lov_tgt_size) {
@@ -602,8 +603,8 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp, out:if (rc) { -CERROR ("add failed (%d), deleting %s\n" , rc, -obd_uuid2str (&tgt->ltd_uuid)); +CERROR ("%s: add failed, deleting %s: rc = %d\n" , + obd->obd_name,obd_uuid2str (&tgt->ltd_uuid), rc);lov_del_target (obd, index,NULL ,0 ); }lov_tgts_putref (obd);
@@ -860,6 +861,7 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,case LCFG_LOV_DEL_OBD : {u32 index;int gen; +/* lov_modify_tgts add 0:lov_mdsA 1:ost1_UUID 2:0 3:1 */ if (LUSTRE_CFG_BUFLEN (lcfg,1 ) >sizeof (obd_uuid.uuid)) { rc = -EINVAL ;
@@ -868,11 +870,11 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,obd_str2uuid (&obd_uuid,lustre_cfg_buf (lcfg,1 )); - rc =kstrtoint (lustre_cfg_buf (lcfg,2 ),10 , indexp); -if (rc <0 ) + rc =kstrtou32 (lustre_cfg_buf (lcfg,2 ),10 , indexp); +if (rc) goto out; rc =kstrtoint (lustre_cfg_buf (lcfg,3 ),10 , genp); -if (rc <0 ) +if (rc) goto out; index = *indexp; gen = *genp;
@@ -882,6 +884,7 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg, rc =lov_add_target (obd, &obd_uuid, index, gen,0 ); else rc =lov_del_target (obd, index, &obd_uuid, gen); + goto out; }case LCFG_PARAM : {
fs/lustre/mdc/mdc_dev.c +1 -1
@@ -684,7 +684,7 @@ int mdc_enqueue_send(const struct lu_env *env, struct obd_export *exp,return ELDLM_OK ; matched =ldlm_handle2lock (&lockh); -if (ldlm_is_kms_ignore (matched)) +if (!matched ||ldlm_is_kms_ignore (matched)) goto no_match;if (mdc_set_dom_lock_data (env, matched, einfo->ei_cbdata)) {
Signature · 1 line
1.8.3.1
PATCH 15/622 lustre: obdclass: allow specifying complex jobids
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Allow specifying a format string for the jobid_name variable to create a jobid for processes on the client. The jobid_name is used when jobid_var=nodelocal, if jobid_name contains "%j", or as a fallback if getting the specified jobid_var from the environment fails.
The jobid_node string allows the following escape sequences:
%e = executable name
%g = group ID
%h = hostname (system utsname)
%j = jobid from jobid_var environment variable %p = process ID
%u = user ID
Any unknown escape sequences are dropped. Other arbitrary characters pass through unmodified, up to the maximum jobid string size of 32, though whitespace within the jobid is not copied.
This allows, for example, specifying an arbitrary prefix, such as the cluster name, in addition to the traditional "procname.uid" format, to distinguish between jobs running on clients in different clusters:
lctl set_param jobid_var=nodelocal jobid_name=cluster2.%e.%u
or
lctl set_param jobid_var=SLURM_JOB_ID jobid_name=cluster2.%j.%e
To use an environment-specified JobID, if available, but fall back to a static string for all processes that do not have a valid JobID:
lctl set_param jobid_var=SLURM_JOB_ID jobid_name=unknown
Implementation notes:
The LUSTRE_JOBID_SIZE includes a trailing NUL, so don't use "LUSTRE_JOBID_SIZE + 1" anywhere, as that is misleading.
Rename the "obd_jobid_node" variable to "obd_jobid_name" to match the sysfs "jobid_name" parameter name to avoid confusion.
Rename "struct jobid_to_pid_map" to "jobid_pid_map" since this is not actually mapping from a jobid *to* a PID, but the reverse. Save jobid length, and reorder fields to avoid holes in structure.
Consolidate PID->jobid cache handling in jobid_get_from_cache(), which only does environment lookups and caches the results. The fallback to using obd_jobid_name is handled by the caller.
Rename check_job_name() to jobid_name_is_valid(), since that makes it clear to the reader a "true" return is a valid name.
In jobid_cache_init() there is no benefit for locking the jobid_hash creation, since the spinlock is just initialized in this function, so multiple callers of this function would already be broken.
Pass the buffer size from the callers (who know the buffer size) to lustre_get_jobid() instead of assuming it is LUSTRE_JOBID_SIZE.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10698
Lustre-commit: 6488c0ec57de ("LU-10698 obdclass: allow specifying complex jobids")
Reviewed-on: https://review.whamcloud.com/31691
--- fs/lustre/include/obd_class.h | 4 +- fs/lustre/llite/llite_internal.h | 4 +- fs/lustre/llite/llite_lib.c | 2 +- fs/lustre/llite/vvp_io.c | 2 +- fs/lustre/llite/vvp_object.c | 3 +- fs/lustre/obdclass/jobid.c | 95 +++++++++++++++++++++++++++++++--- fs/lustre/obdclass/obd_sysfs.c | 10 ++-- fs/lustre/ptlrpc/pack_generic.c | 4 +- include/uapi/linux/lustre/lustre_idl.h | 2 +- 9 files changed, 105 insertions(+), 21 deletions(-)
fs/lustre/include/obd_class.h +2 -2
@@ -54,7 +54,7 @@/* OBD Operations Declarations */ struct obd_device *class_exp2obd (struct obd_export *exp);int class_handle_ioctl (unsigned int cmd,unsigned long arg); -int lustre_get_jobid (char *jobid); +int lustre_get_jobid (char *jobid,size_t len);struct lu_device_type ;
@@ -1672,7 +1672,7 @@ static inline void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out)int class_check_uuid (struct obd_uuid *uuid,u64 nid);/* class_obd.c */ -extern char obd_jobid_node[]; +extern char obd_jobid_name[];int class_procfs_init (void );int class_procfs_clean (void );
fs/lustre/llite/llite_internal.h +2 -2
@@ -195,11 +195,11 @@ struct ll_inode_info {int lli_async_rc;/* -* whenever a process try to read/write the file, the +* Whenever a process try to read/write the file, the * jobid of the process will be saved here, and it'll * be packed into the write PRC when flush later. * -* so the read/write statistics for jobid will not be +* So the read/write statistics for jobid will not be * accurate if the file is shared by different jobs. */ char lli_jobid[LUSTRE_JOBID_SIZE ];
fs/lustre/llite/llite_lib.c +1 -1
@@ -937,7 +937,7 @@ void ll_lli_init(struct ll_inode_info *lli) lli->lli_async_rc =0 ; }mutex_init (&lli->lli_layout_mutex); -memset (lli->lli_jobid,0 ,LUSTRE_JOBID_SIZE ); +memset (lli->lli_jobid,0 ,sizeof (lli->lli_jobid)); }int ll_fill_super (struct super_block *sb)
fs/lustre/llite/vvp_io.c +1 -1
@@ -1419,7 +1419,7 @@ int vvp_io_init(const struct lu_env *env, struct cl_object *obj,* it's not accurate if the file is shared by different * jobs. */ -lustre_get_jobid (lli->lli_jobid); +lustre_get_jobid (lli->lli_jobid,sizeof (lli->lli_jobid)); }else if (io->ci_type ==CIT_SETATTR ) {if (!cl_io_is_trunc (io)) io->ci_lockreq =CILR_MANDATORY ;
fs/lustre/llite/vvp_object.c +2 -1
@@ -212,7 +212,8 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj,obdo_set_parent_fid (oa, &ll_i2info (inode)->lli_fid);if (OBD_FAIL_CHECK (OBD_FAIL_LFSCK_INVALID_PFID )) oa->o_parent_oid++; -memcpy (attr->cra_jobid,ll_i2info (inode)->lli_jobid,LUSTRE_JOBID_SIZE ); +memcpy (attr->cra_jobid,ll_i2info (inode)->lli_jobid, +sizeof (attr->cra_jobid)); }static const struct cl_object_operations vvp_ops = {
fs/lustre/obdclass/jobid.c +89 -6
125 lines not on this page · raw message
fs/lustre/obdclass/obd_sysfs.c +5 -5
@@ -233,7 +233,7 @@ static ssize_t jobid_var_store(struct kobject *kobj, struct attribute *attr,static ssize_t jobid_name_show (struct kobject *kobj,struct attribute *attr,char *buf) { -return snprintf (buf,PAGE_SIZE ,"%s\n" , obd_jobid_node); +return snprintf (buf,PAGE_SIZE ,"%s\n" , obd_jobid_name); } static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr,
@@ -243,13 +243,13 @@ static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr,if (!count || count >LUSTRE_JOBID_SIZE )return -EINVAL ; -memcpy (obd_jobid_node, buffer, count); +memcpy (obd_jobid_name, buffer, count); - obd_jobid_node[count] =0 ; + obd_jobid_name[count] =0 ;/* Trim the trailing '\n' if any */ -if (obd_jobid_node[count -1 ] =='\n' ) - obd_jobid_node[count -1 ] =0 ; +if (obd_jobid_name[count -1 ] =='\n' ) + obd_jobid_name[count -1 ] =0 ;return count; }
fs/lustre/ptlrpc/pack_generic.c +2 -2
@@ -1406,9 +1406,9 @@ void lustre_msg_set_jobid(struct lustre_msg *msg, char *jobid)LASSERTF (pb,"invalid msg %p: no ptlrpc body!\n" , msg);if (jobid) -memcpy (pb->pb_jobid, jobid,LUSTRE_JOBID_SIZE ); +memcpy (pb->pb_jobid, jobid,sizeof (pb->pb_jobid));else if (pb->pb_jobid[0 ] =='\0' ) -lustre_get_jobid (pb->pb_jobid); +lustre_get_jobid (pb->pb_jobid,sizeof (pb->pb_jobid));return ; }default :
include/uapi/linux/lustre/lustre_idl.h +1 -1
@@ -635,7 +635,7 @@ struct ptlrpc_body_v3 {__u64 pb_padding64_0;__u64 pb_padding64_1;__u64 pb_padding64_2; -char pb_jobid[LUSTRE_JOBID_SIZE ];/* req: ASCII MPI jobid from env */ +char pb_jobid[LUSTRE_JOBID_SIZE ];/* req: ASCII jobid from env + NUL */ };#define ptlrpc_body ptlrpc_body_v3
Signature · 1 line
1.8.3.1
PATCH 16/622 lustre: ldlm: don't disable softirq for exp_rpc_lock
In reply to James SimmonsFrom: Liang Zhen <[email protected]>
it is not necessary to call ldlm_lock_busy() in the context of timer callback, we can call it in thread context of expired_lock_main. With this change, we don't need to disable softirq for exp_rpc_lock.
Instead of moving busy locks to the end of the waiting list one at a time in the context of the timer callback, move any locks that may be expired onto the expired list. If these locks are still being used by RPCs being processed, then put them back onto the end of the waiting list instead of evicting the client.
For the linux client the impact of this change is change of spin_lock_bh() to spin_lock() for the exp_rpc_lock.
WC-bug-id: https://jira.whamcloud.com/browse/LU-6032
Lustre-commit: 292aa42e0897 ("LU-6032 ldlm: don't disable softirq for exp_rpc_lock")
Reviewed-on: https://review.whamcloud.com/12957
--- fs/lustre/ptlrpc/service.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/lustre/ptlrpc/service.c +4 -4
@@ -1307,9 +1307,9 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,LASSERT (rc <=1 ); } -spin_lock_bh (&req->rq_export->exp_rpc_lock); +spin_lock (&req->rq_export->exp_rpc_lock);list_add (&req->rq_exp_list, &req->rq_export->exp_hp_rpcs); -spin_unlock_bh (&req->rq_export->exp_rpc_lock); +spin_unlock (&req->rq_export->exp_rpc_lock); }ptlrpc_nrs_req_initialize (svcpt, req, rc);
@@ -1327,9 +1327,9 @@ static void ptlrpc_server_hpreq_fini(struct ptlrpc_request *req)if (req->rq_ops->hpreq_fini) req->rq_ops->hpreq_fini (req); -spin_lock_bh (&req->rq_export->exp_rpc_lock); +spin_lock (&req->rq_export->exp_rpc_lock);list_del_init (&req->rq_exp_list); -spin_unlock_bh (&req->rq_export->exp_rpc_lock); +spin_unlock (&req->rq_export->exp_rpc_lock); } }
Signature · 1 line
1.8.3.1
PATCH 17/622 lustre: obdclass: new wrapper to convert NID to string
In reply to James SimmonsFrom: Liang Zhen <[email protected]>
This patch includes a couple of changes:
- add new wrapper function obd_import_nid2str
- use obd_import_nid2str and obd_export_nid2str to replace all libcfs_nid2str conversions for NID of export/import connection
WC-bug-id: https://jira.whamcloud.com/browse/LU-6032
Lustre-commit: 61f9847a812f ("LU-6032 obdclass: new wrapper to convert NID to string")
Reviewed-on: https://review.whamcloud.com/12956
--- fs/lustre/include/obd_class.h | 12 ++++++++++++ fs/lustre/ldlm/ldlm_lock.c | 4 ++-- fs/lustre/ptlrpc/client.c | 5 ++--- fs/lustre/ptlrpc/import.c | 6 +++--- 4 files changed, 19 insertions(+), 8 deletions(-)
fs/lustre/include/obd_class.h +12 -0
@@ -86,6 +86,18 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid,int obd_connect_flags2str (char *page,int count,u64 flags,u64 flags2,const char *sep); +static inline char *obd_export_nid2str (struct obd_export *exp) +{ +return exp->exp_connection ? +libcfs_nid2str (exp->exp_connection->c_peer.nid) :"<unknown>" ; +} + +static inline char *obd_import_nid2str (struct obd_import *imp) +{ +return imp->imp_connection ? +libcfs_nid2str (imp->imp_connection->c_peer.nid) :"<unknown>" ; +} +int obd_zombie_impexp_init (void );void obd_zombie_impexp_stop (void );void obd_zombie_barrier (void );
fs/lustre/ldlm/ldlm_lock.c +2 -2
@@ -1987,11 +1987,11 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, vaf.va = &args;if (exp && exp->exp_connection) { - nid =libcfs_nid2str (exp->exp_connection->c_peer.nid); + nid =obd_export_nid2str (exp); }else if (exp && exp->exp_obd) {struct obd_import *imp = exp->exp_obd->u.cli.cl_import; - nid =libcfs_nid2str (imp->imp_connection->c_peer.nid); + nid =obd_import_nid2str (imp); }if (!resource) {
fs/lustre/ptlrpc/client.c +2 -3
@@ -1605,8 +1605,7 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req) current->comm, imp->imp_obd->obd_uuid.uuid,lustre_msg_get_status (req->rq_reqmsg), req->rq_xid, -libcfs_nid2str (imp->imp_connection->c_peer.nid), - lustre_msg_get_opc(req->rq_reqmsg)); + obd_import_nid2str(imp), lustre_msg_get_opc(req->rq_reqmsg)); rc =ptl_send_rpc (req,0 );if (rc == -ENOMEM ) {
@@ -2017,7 +2016,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set) current->comm, imp->imp_obd->obd_uuid.uuid,lustre_msg_get_status (req->rq_reqmsg), req->rq_xid, -libcfs_nid2str (imp->imp_connection->c_peer.nid), +obd_import_nid2str (imp), lustre_msg_get_opc(req->rq_reqmsg));spin_lock (&imp->imp_lock);
fs/lustre/ptlrpc/import.c +3 -3
@@ -171,13 +171,13 @@ int ptlrpc_set_import_discon(struct obd_import *imp, u32 conn_cnt)LCONSOLE_WARN ("%s: Connection to %.*s (at %s) was lost; in progress operations using this service will wait for recovery to complete\n" , imp->imp_obd->obd_name, target_len, target_start, -libcfs_nid2str (imp->imp_connection->c_peer.nid)); +obd_import_nid2str (imp)); }else {LCONSOLE_ERROR_MSG (0x166 ,"%s: Connection to %.*s (at %s) was lost; in progress operations using this service will fail\n" , imp->imp_obd->obd_name, target_len, target_start, -libcfs_nid2str (imp->imp_connection->c_peer.nid)); +obd_import_nid2str (imp)); }IMPORT_SET_STATE_NOLOCK (imp,LUSTRE_IMP_DISCON );spin_unlock (&imp->imp_lock);
@@ -1461,7 +1461,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)LCONSOLE_INFO ("%s: Connection restored to %.*s (at %s)\n" , imp->imp_obd->obd_name, target_len, target_start, -libcfs_nid2str (imp->imp_connection->c_peer.nid)); +obd_import_nid2str (imp)); }if (imp->imp_state ==LUSTRE_IMP_FULL ) {
Signature · 1 line
1.8.3.1
PATCH 18/622 lustre: ptlrpc: Add QoS for uid and gid in NRS-TBF
In reply to James SimmonsFrom: Teddy Chan <[email protected]>
This patch add a new QoS feature in TBF policy which could limits the rate based on uid or gid. The policy is able to limit the rate both on MDT and OSS site.
The command for this feature is like:
Start the tbf uid QoS on OST:
lctl set_param ost.OSS.*.nrs_policies="tbf uid"
Limit the rate of ptlrpc requests of the uid 500
lctl set_param ost.OSS.*.nrs_tbf_rule=
"start tbf_name uid={500} rate=100"
Start the tbf gid QoS on OST:
lctl set_param ost.OSS.*.nrs_policies="tbf gid"
Limit the rate of ptlrpc requests of the gid 500
lctl set_param ost.OSS.*.nrs_tbf_rule=
"start tbf_name gid={500} rate=100"
or use generic tbf rule to mix them on OST:
lctl set_param ost.OSS.*.nrs_policies="tbf"
Limit the rate of ptlrpc requests of the uid 500 gid 500
lctl set_param ost.OSS.*.nrs_tbf_rule=
"start tbf_name uid={500}&gid={500} rate=100"
Also, you can use the following rule to control all reqs to mds:
Start the tbf uid QoS on MDS:
lctl set_param mds.MDS.*.nrs_policies="tbf uid"
Limit the rate of ptlrpc requests of the uid 500
lctl set_param mds.MDS.*.nrs_tbf_rule=
"start tbf_name uid={500} rate=100"
For the linux client we need to send the uid and gid information to the NRS-TBF handling on the servers.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9658
Lustre-commit: e0cdde123c14 ("LU-9658 ptlrpc: Add QoS for uid and gid in NRS-TBF")
Reviewed-on: https://review.whamcloud.com/27608
--- fs/lustre/llite/vvp_object.c | 5 ++--- fs/lustre/obdclass/obdo.c | 5 +++++ fs/lustre/osc/osc_request.c | 10 ++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-)
fs/lustre/llite/vvp_object.c +2 -3
@@ -196,7 +196,7 @@ static int vvp_object_glimpse(const struct lu_env *env,static void vvp_req_attr_set (const struct lu_env *env,struct cl_object *obj,struct cl_req_attr *attr) { -u64 valid_flags =OBD_MD_FLTYPE ; +u64 valid_flags =OBD_MD_FLTYPE |OBD_MD_FLUID |OBD_MD_FLGID ;struct inode *inode;struct obdo *oa;
@@ -204,8 +204,7 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj, inode =vvp_object_inode (obj);if (attr->cra_type ==CRT_WRITE ) { - valid_flags |=OBD_MD_FLMTIME |OBD_MD_FLCTIME | -OBD_MD_FLUID |OBD_MD_FLGID ; + valid_flags |=OBD_MD_FLMTIME |OBD_MD_FLCTIME ;obdo_set_o_projid (oa,ll_i2info (inode)->lli_projid); }obdo_from_inode (oa, inode, valid_flags & attr->cra_flags);
fs/lustre/obdclass/obdo.c +5 -0
@@ -144,6 +144,11 @@ void lustre_set_wire_obdo(const struct obd_connect_data *ocd,if (!ocd)return ; +if (!(wobdo->o_valid &OBD_MD_FLUID )) + wobdo->o_uid =from_kuid (&init_user_ns,current_uid ()); +if (!(wobdo->o_valid &OBD_MD_FLGID )) + wobdo->o_gid =from_kgid (&init_user_ns,current_gid ()); +if (unlikely (!(ocd->ocd_connect_flags &OBD_CONNECT_FID )) &&fid_seq_is_echo (ostid_seq (&lobdo->o_oi))) {/*
fs/lustre/osc/osc_request.c +10 -0
@@ -1184,6 +1184,16 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,lustre_set_wire_obdo (&req->rq_import->imp_connect_data, &body->oa, oa); +/* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() +* and from_kgid(), because they are asynchronous. Fortunately, variable +* oa contains valid o_uid and o_gid in these two operations. +* Besides, filling o_uid and o_gid is enough for nrs-tbf, see LU-9658. +* OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking +* other process logic +*/ + body->oa.o_uid = oa->o_uid; + body->oa.o_gid = oa->o_gid; +obdo_to_ioobj (oa, ioobj); ioobj->ioo_bufcnt = niocount;/* The high bits of ioo_max_brw tells server _maximum_ number of bulks
Signature · 1 line
1.8.3.1
PATCH 19/622 lustre: hsm: ignore compound_id
In reply to James SimmonsFrom: "John L. Hammond" <[email protected]>
Ignore request compound ids in the HSM coordinator. Compound ids prevent batching of CDT to CT requests and degrade HSM performance. Use CT/archive id compatabiliy when deciding which HSM actions to put in a request.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10383
Lustre-commit: 9ee81f920bb3 ("LU-10383 hsm: ignore compound_id")
Reviewed-on: https://review.whamcloud.com/30949
--- include/uapi/linux/lustre/lustre_idl.h | 2 +- include/uapi/linux/lustre/lustre_user.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/lustre/lustre_idl.h +1 -1
@@ -2508,7 +2508,7 @@ struct llog_agent_req_rec {*/ __u32 arr_archive_id;/**< backend archive number */ __u64 arr_flags;/**< req flags */ -__u64 arr_compound_id;/**< compound cookie */ +__u64 arr_compound_id;/**< compound cookie, ignored */ __u64 arr_req_create;/**< req. creation time */ __u64 arr_req_change;/**< req. status change time */ struct hsm_action_item arr_hai;/**< req. to the agent */
include/uapi/linux/lustre/lustre_user.h +1 -1
@@ -1729,7 +1729,7 @@ static inline char *hai_dump_data_field(struct hsm_action_item *hai,struct hsm_action_list {__u32 hal_version;__u32 hal_count;/* number of hai's to follow */ -__u64 hal_compound_id;/* returned by coordinator */ +__u64 hal_compound_id;/* returned by coordinator, ignored */ __u64 hal_flags;__u32 hal_archive_id;/* which archive backend */ __u32 padding1;
Signature · 1 line
1.8.3.1
PATCH 20/622 lnet: libcfs: remove unnecessary set_fs(KERNEL_DS)
In reply to James SimmonsFrom: Mike Marciniszyn <[email protected]>
When we converted to using kernel_write(), we left some set_fs() calls that are not unnecessary. Remove them.
Original OpenSFS version of this patch, as mentioned below, did the full conversion to kernel_write.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10560
lustre-commit: b9a32054600a ("LU-10560 libcfs: Use kernel_write when appropriate")
Reviewed-on: https://review.whamcloud.com/31154
--- net/lnet/libcfs/tracefile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/lnet/libcfs/tracefile.c +1 -4
@@ -807,7 +807,6 @@ int cfs_tracefile_dump_all_pages(char *filename)struct cfs_trace_page *tage;struct cfs_trace_page *tmp;char *buf; -mm_segment_t __oldfs;int rc;down_write (&cfs_tracefile_sem);
@@ -828,8 +827,6 @@ int cfs_tracefile_dump_all_pages(char *filename) rc =0 ; goto close; } - __oldfs =get_fs (); -set_fs (KERNEL_DS );/* ok, for now, just write the pages. in the future we'll be building * iobufs with the pages and calling generic_direct_IO
@@ -851,7 +848,7 @@ int cfs_tracefile_dump_all_pages(char *filename)list_del (&tage->linkage);cfs_tage_free (tage); } -set_fs (__oldfs); + rc =vfs_fsync (filp,1 );if (rc)pr_err ("sync returns %d\n" , rc);
Signature · 1 line
1.8.3.1
PATCH 21/622 lustre: ptlrpc: ptlrpc_register_bulk() LBUG on ENOMEM
In reply to James SimmonsFrom: Andriy Skulysh <[email protected]>
Assertion fails on !desc->bd_registered during
retry after ENOMEM.
Drop bd_registered flag and exit via cleanup_bulk
to ensure that bulk is fully unregistered.
Cray-bug-id: MRP-4733
WC-bug-id: https://jira.whamcloud.com/browse/LU-10643
Lustre-commit: 4a81be263079 ("LU-10643 ptlrpc: ptlrpc_register_bulk() LBUG on ENOMEM")
Reviewed-on: https://review.whamcloud.com/31228
--- fs/lustre/include/obd_support.h | 1 + fs/lustre/ptlrpc/niobuf.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-)
fs/lustre/include/obd_support.h +1 -0
@@ -349,6 +349,7 @@#define OBD_FAIL_PTLRPC_DROP_BULK 0x51a#define OBD_FAIL_PTLRPC_LONG_REQ_UNLINK 0x51b#define OBD_FAIL_PTLRPC_LONG_BOTH_UNLINK 0x51c +#define OBD_FAIL_PTLRPC_BULK_ATTACH 0x521#define OBD_FAIL_OBD_PING_NET 0x600#define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
fs/lustre/ptlrpc/niobuf.c +9 -3
@@ -179,8 +179,13 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req) LNET_MD_OP_GET : LNET_MD_OP_PUT);ptlrpc_fill_bulk_md (&md, desc, posted_md); - rc =LNetMEAttach (desc->bd_portal, peer, mbits,0 , -LNET_UNLINK ,LNET_INS_AFTER , &me_h); +if (posted_md >0 && posted_md +1 == total_md && +OBD_FAIL_CHECK (OBD_FAIL_PTLRPC_BULK_ATTACH )) { + rc = -ENOMEM ; + }else { + rc =LNetMEAttach (desc->bd_portal, peer, mbits,0 , +LNET_UNLINK ,LNET_INS_AFTER , &me_h); + }if (rc !=0 ) { CERROR("%s: LNetMEAttach failed x%llu/%d: rc = %d\n", desc->bd_import->imp_obd->obd_name, mbits,
@@ -209,6 +214,7 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req)LASSERT (desc->bd_md_count >=0 );mdunlink_iterate_helper (desc->bd_mds, desc->bd_md_max_brw); req->rq_status = -ENOMEM ; + desc->bd_registered =0 ;return -ENOMEM ; }
@@ -585,7 +591,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)if (request->rq_bulk) { rc =ptlrpc_register_bulk (request);if (rc !=0 ) - goto out; + goto cleanup_bulk;/* * All the mds in the request will have the same cpt * encoded in the cookie. So we can just get the first
Signature · 1 line
1.8.3.1
PATCH 22/622 lustre: llite: yield cpu after call to ll_agl_trigger
In reply to James SimmonsFrom: Ann Koehler <[email protected]>
The statahead and agl threads loop over all entries in the directory without yielding the CPU. If the number of entries in the directory is large enough then these threads may trigger soft lockups. The fix is to add calls to cond_resched() after calling ll_agl_trigger(), which gets the glimpse lock for a file.
Cray-bug-id: LUS-2584
WC-bug-id: https://jira.whamcloud.com/browse/LU-10649
Lustre-commit: 031001f0d438 ("LU-10649 llite: yield cpu after call to ll_agl_trigger")
Reviewed-on: https://review.whamcloud.com/31240
--- fs/lustre/llite/statahead.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/lustre/llite/statahead.c +2 -1
@@ -907,6 +907,7 @@ static int ll_agl_thread(void *arg)list_del_init (&clli->lli_agl_list);spin_unlock (&plli->lli_agl_lock);ll_agl_trigger (&clli->lli_vfs_inode, sai); +cond_resched (); }else {spin_unlock (&plli->lli_agl_lock); }
@@ -1071,7 +1072,7 @@ static int ll_statahead_thread(void *arg)ll_agl_trigger (&clli->lli_vfs_inode, sai); - +cond_resched ();spin_lock (&lli->lli_agl_lock); }spin_unlock (&lli->lli_agl_lock);
Signature · 1 line
1.8.3.1
PATCH 23/622 lustre: osc: Do not request more than 2GiB grant
In reply to James SimmonsFrom: Patrick Farrell <[email protected]>
The server enforces a grant limit of 2 GiB, which the client must honor. The existing client code combined with 16 MiB RPCs make it possible for the client to ask for more than this limit.
Make this limit explicit, and also fix an overflow bug in o_undirty calculation in osc_announce_cached. (o_undirty is a 32 bit value and 16 MiB*256 rpcs_in_flight = 4 GiB. 4 GiB + extra grant components overflows o_undirty.)
Cray-bug-id: LUS-5750
WC-bug-id: https://jira.whamcloud.com/browse/LU-10776
Lustre-commit: c0246d887809 ("LU-10776 osc: Do not request more than 2GiB grant")
Reviewed-on: https://review.whamcloud.com/31533
--- fs/lustre/osc/osc_request.c | 10 ++++++++-- include/uapi/linux/lustre/lustre_idl.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-)
fs/lustre/osc/osc_request.c +8 -2
@@ -664,11 +664,12 @@ static void osc_announce_cached(struct client_obd *cli, struct obdo *oa, oa->o_undirty =0 ; }else {unsigned long nrpages; +unsigned long undirty; nrpages = cli->cl_max_pages_per_rpc; nrpages *= cli->cl_max_rpcs_in_flight +1 ; nrpages =max (nrpages, cli->cl_dirty_max_pages); - oa->o_undirty = nrpages <<PAGE_SHIFT ; + undirty = nrpages <<PAGE_SHIFT ;if (OCD_HAS_FLAG (&cli->cl_import->imp_connect_data,GRANT_PARAM )) {int nrextents;
@@ -679,8 +680,13 @@ static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,*/ nrextents =DIV_ROUND_UP (nrpages, cli->cl_max_extent_pages); - oa->o_undirty += nrextents * cli->cl_grant_extent_tax; + undirty += nrextents * cli->cl_grant_extent_tax; } +/* Do not ask for more than OBD_MAX_GRANT - a margin for server +* to add extent tax, etc. +*/ + oa->o_undirty =min (undirty,OBD_MAX_GRANT - + (PTLRPC_MAX_BRW_PAGES <<PAGE_SHIFT )*4UL ); } oa->o_grant = cli->cl_avail_grant + cli->cl_reserved_grant; oa->o_dropped = cli->cl_lost_grant;
include/uapi/linux/lustre/lustre_idl.h +2 -0
@@ -1213,6 +1213,8 @@ struct hsm_state_set {* it to sync quickly */ +#define OBD_MAX_GRANT 0x7fffffffUL/* Max grant allowed to one client: 2 GiB */ +#define OBD_OBJECT_EOF LUSTRE_EOF#define OST_MIN_PRECREATE 32
Signature · 1 line
1.8.3.1
PATCH 24/622 lustre: llite: rename FSFILT_IOC_* to system flags
In reply to James SimmonsFrom: Jinshan Xiong <[email protected]>
Those definitions were probably created for compatibility. Now that FS_IOC_* have been existing in kernel for long time, we should use them to avoid confusion.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10779
Lustre-commit: 7e3fc106d6e7 ("LU-10779 llite: rename FSFILT_IOC_* to system flags")
Reviewed-on: https://review.whamcloud.com/31546
--- fs/lustre/llite/dir.c | 13 +++++++------ fs/lustre/llite/file.c | 19 ++++++++++--------- fs/lustre/llite/llite_lib.c | 4 ++-- 3 files changed, 19 insertions(+), 17 deletions(-)
fs/lustre/llite/dir.c +7 -6
@@ -1108,18 +1108,19 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)ll_stats_ops_tally (ll_i2sbi (inode),LPROC_LL_IOCTL ,1 );switch (cmd) { -case FSFILT_IOC_GETFLAGS : -case FSFILT_IOC_SETFLAGS : +case FS_IOC_GETFLAGS : +case FS_IOC_SETFLAGS :return ll_iocontrol (inode, file, cmd, arg); -case FSFILT_IOC_GETVERSION_OLD :case FSFILT_IOC_GETVERSION : +case FS_IOC_GETVERSION :return put_user (inode->i_generation, (int __user *)arg);/* We need to special case any other ioctls we want to handle, * to send them to the MDS/OST as appropriate and to properly * network encode the arg field. -case FSFILT_IOC_SETVERSION_OLD: -case FSFILT_IOC_SETVERSION: -*/ +*/ +case FS_IOC_SETVERSION : +return -ENOTSUPP ; +case LL_IOC_GET_MDTIDX : {int mdtidx;
fs/lustre/llite/file.c +10 -9
@@ -3055,12 +3055,19 @@ static long ll_file_set_lease(struct file *file, struct ll_ioc_lease *ioc,case LL_IOC_LOV_GETSTRIPE :case LL_IOC_LOV_GETSTRIPE_NEW :return ll_file_getstripe (inode, (void __user *)arg,0 ); -case FSFILT_IOC_GETFLAGS : -case FSFILT_IOC_SETFLAGS : +case FS_IOC_GETFLAGS : +case FS_IOC_SETFLAGS :return ll_iocontrol (inode, file, cmd, arg); -case FSFILT_IOC_GETVERSION_OLD :case FSFILT_IOC_GETVERSION : +case FS_IOC_GETVERSION :return put_user (inode->i_generation, (int __user *)arg); +/* We need to special case any other ioctls we want to handle, +* to send them to the MDS/OST as appropriate and to properly +* network encode the arg field. +*/ +case FS_IOC_SETVERSION : +return -ENOTSUPP ; +case LL_IOC_GROUP_LOCK :return ll_get_grouplock (inode, file, arg);case LL_IOC_GROUP_UNLOCK :
@@ -3068,12 +3075,6 @@ static long ll_file_set_lease(struct file *file, struct ll_ioc_lease *ioc,case IOC_OBD_STATFS :return ll_obd_statfs (inode, (void __user *)arg); -/* We need to special case any other ioctls we want to handle, -* to send them to the MDS/OST as appropriate and to properly -* network encode the arg field. -case FSFILT_IOC_SETVERSION_OLD: -case FSFILT_IOC_SETVERSION: -*/ case LL_IOC_FLUSHCTX :return ll_flush_ctx (inode);case LL_IOC_PATH2FID : {
fs/lustre/llite/llite_lib.c +2 -2
@@ -2037,7 +2037,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,int rc, flags =0 ;switch (cmd) { -case FSFILT_IOC_GETFLAGS : { +case FS_IOC_GETFLAGS : {struct mdt_body *body;struct md_op_data *op_data;
@@ -2065,7 +2065,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,return put_user (flags, (int __user *)arg); } -case FSFILT_IOC_SETFLAGS : { +case FS_IOC_SETFLAGS : {struct md_op_data *op_data;struct cl_object *obj;struct iattr *attr;
Signature · 1 line
1.8.3.1
PATCH 25/622 lnet: fix nid range format '*@<net>' support
In reply to James SimmonsFrom: Emoly Liu <[email protected]>
In cfs_ip_min_max(), (nidrange->nr_all == 1) means this nid range is a full IP address range(*.*.*.*). In this case, we don't need to compare it to any other nid range, but set min_nid to 0.0.0.0 and max_nid to 255.255.255.255 directly.
WC-bug-id: https://jira.whamcloud.com/browse/LU-8913
Lustre-commit: 230266326f49 ("LU-8913 nodemap: fix nodemap range format '*@<net>' support")
Reviewed-on: https://review.whamcloud.com/31684
--- net/lnet/lnet/nidstrings.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/lnet/lnet/nidstrings.c +6 -0
@@ -680,6 +680,12 @@ static int cfs_ip_min_max(struct list_head *nidlist, u32 *min_nid,if (nidlist_count >0 )return -EINVAL ; +if (nr->nr_all) { + min_ip_addr =0 ; + max_ip_addr =0xffffffff ; +break ; + } +list_for_each_entry (ar, &nr->nr_addrranges, ar_link) { rc =cfs_ip_ar_min_max (ar, &tmp_min_ip_addr, &tmp_max_ip_addr);
Signature · 1 line
1.8.3.1
PATCH 26/622 lustre: ptlrpc: fix test_req_buffer_pressure behavior
In reply to James SimmonsFrom: Bruno Faccini <[email protected]>
In 2nd patch for LU-9372, to allow limiting number of rqbd-buffers, a wrong and unnecessary test had been added to enhance test_req_buffer_pressure feature.
This patch fixes this issue by removing such test.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10826
Lustre-commit: 040eca67f8d5 ("LU-10826 ptlrpc: fix test_req_buffer_pressure behavior")
Reviewed-on: https://review.whamcloud.com/31690
--- fs/lustre/ptlrpc/service.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/lustre/ptlrpc/service.c +1 -2
@@ -150,8 +150,7 @@/* NB: another thread might have recycled enough rqbds, we * need to make sure it wouldn't over-allocate, see LU-1212. */ -if (test_req_buffer_pressure || - svcpt->scp_nrqbds_posted >= svc->srv_nbuf_per_group || +if (svcpt->scp_nrqbds_posted >= svc->srv_nbuf_per_group || (svc->srv_nrqbds_max !=0 && svcpt->scp_nrqbds_total > svc->srv_nrqbds_max))break ;
Signature · 1 line
1.8.3.1
PATCH 27/622 lustre: lu_object: improve debug message for lu_object_put()
In reply to James SimmonsFrom: Alexey Lyashkov <[email protected]>
Use a top level object in debug in lu_object_put to match with lu_object_get.
WC-bug-id: https://jira.whamcloud.com/browse/LU-LU-10877
Lustre-commit: fd669eba1921 ("LU-10877 lu: fix reference leak")
Reviewed-on: https://review.whamcloud.com/31870
--- fs/lustre/obdclass/lu_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/lustre/obdclass/lu_object.c +2 -2
@@ -184,8 +184,8 @@ void lu_object_put(const struct lu_env *env, struct lu_object *o)LASSERT (list_empty (&top->loh_lru));list_add_tail (&top->loh_lru, &bkt->lsb_lru);percpu_counter_inc (&site->ls_lru_len_counter); -CDEBUG (D_INODE ,"Add %p to site lru. hash: %p, bkt: %p\n" , - o, site->ls_obj_hash, bkt); +CDEBUG (D_INODE ,"Add %p/%p to site lru. hash: %p, bkt: %p\n" , + orig, top, site->ls_obj_hash, bkt);cfs_hash_bd_unlock (site->ls_obj_hash, &bd,1 );return ; }
Signature · 1 line
1.8.3.1
PATCH 28/622 lustre: idl: remove obsolete directory split flags
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
The directory split functionality from the old CMD (pre-DNE) feature was never usable in production, and was removed before the DNE 2.4 release. Remove old flags relating to this feature.
WC-bug-id: https://jira.whamcloud.com/browse/LU-1187
Lustre-commit: 5c53c353fd82 ("LU-1187 idl: remove obsolete directory split flags")
Reviewed-on: https://review.whamcloud.com/31700
--- fs/lustre/mdc/mdc_lib.c | 2 -- fs/lustre/ptlrpc/wiretest.c | 4 ---- include/uapi/linux/lustre/lustre_idl.h | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-)
fs/lustre/mdc/mdc_lib.c +0 -2
@@ -520,8 +520,6 @@ void mdc_getattr_pack(struct ptlrpc_request *req, u64 valid, u32 flags, &RMF_MDT_BODY); b->mbo_valid = valid; -if (op_data->op_bias &MDS_CHECK_SPLIT ) - b->mbo_valid |=OBD_MD_FLCKSPLIT ;if (op_data->op_bias &MDS_CROSS_REF ) b->mbo_valid |=OBD_MD_FLCROSSREF ; b->mbo_eadatasize = ea_size;
fs/lustre/ptlrpc/wiretest.c +0 -4
@@ -1341,8 +1341,6 @@ void lustre_assert_wire_constants(void) OBD_MD_FLMDSCAPA);LASSERTF (OBD_MD_FLOSSCAPA == (0x0000040000000000ULL ),"found 0x%.16llxULL\n" ,OBD_MD_FLOSSCAPA ); -LASSERTF (OBD_MD_FLCKSPLIT == (0x0000080000000000ULL ),"found 0x%.16llxULL\n" , -OBD_MD_FLCKSPLIT );LASSERTF (OBD_MD_FLCROSSREF == (0x0000100000000000ULL ),"found 0x%.16llxULL\n" ,OBD_MD_FLCROSSREF ); LASSERTF(OBD_MD_FLGETATTRLOCK == (0x0000200000000000ULL), "found 0x%.16llxULL\n",
@@ -1866,8 +1864,6 @@ void lustre_assert_wire_constants(void)LASSERTF ((int )sizeof (((struct ll_fid *)0 )->f_type) ==4 ,"found %lld\n" , (long long )(int )sizeof (((struct ll_fid *)0 )->f_type)); -LASSERTF (MDS_CHECK_SPLIT ==0x00000001UL ,"found 0x%.8xUL\n" , - (unsigned int )MDS_CHECK_SPLIT );LASSERTF (MDS_CROSS_REF ==0x00000002UL ,"found 0x%.8xUL\n" , (unsigned int )MDS_CROSS_REF ); LASSERTF(MDS_VTX_BYPASS == 0x00000004UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +2 -2
@@ -1131,7 +1131,7 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)/* OBD_MD_FLRMTPERM (0x0000010000000000ULL) remote perm, obsolete */ #define OBD_MD_FLMDSCAPA (0x0000020000000000ULL)/* MDS capability */ #define OBD_MD_FLOSSCAPA (0x0000040000000000ULL)/* OSS capability */ -#define OBD_MD_FLCKSPLIT (0x0000080000000000ULL)/* Check split on server */ +/* OBD_MD_FLCKSPLIT (0x0000080000000000ULL) obsolete 2.3.58*/ #define OBD_MD_FLCROSSREF (0x0000100000000000ULL)/* Cross-ref case */ #define OBD_MD_FLGETATTRLOCK (0x0000200000000000ULL)/* Get IOEpoch attributes * under lock; for xattr
@@ -1640,7 +1640,7 @@ struct mdt_rec_setattr {#define MDS_ATTR_PROJID 0x10000ULL/* = 65536 */ enum mds_op_bias { -MDS_CHECK_SPLIT =1 <<0 , +/* MDS_CHECK_SPLIT = 1 << 0, obsolete before 2.3.58 */ MDS_CROSS_REF =1 <<1 ,MDS_VTX_BYPASS =1 <<2 ,MDS_PERM_BYPASS =1 <<3 ,
Signature · 1 line
1.8.3.1
PATCH 29/622 lustre: mdc: resend quotactl if needed
In reply to James SimmonsFrom: Hongchao Zhang <[email protected]>
In mdc_quotactl, it is better to resend the quotactl request if reconnection or failover is triggered during the process.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10368
Lustre-commit: d511918e8eb7 ("LU-10368 mdc: resend quotactl if needed")
Reviewed-on: https://review.whamcloud.com/31773
--- fs/lustre/mdc/mdc_request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/lustre/mdc/mdc_request.c +1 -2
@@ -1867,7 +1867,7 @@ static int mdc_ioc_hsm_ct_start(struct obd_export *exp, struct lustre_kernelcomm *lk);static int mdc_quotactl (struct obd_device *unused,struct obd_export *exp, -struct obd_quotactl *oqctl) +struct obd_quotactl *oqctl) {struct ptlrpc_request *req;struct obd_quotactl *oqc;
@@ -1884,7 +1884,6 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,ptlrpc_request_set_replen (req);ptlrpc_at_set_req_timeout (req); - req->rq_no_resend =1 ; rc =ptlrpc_queue_wait (req);if (rc)
Signature · 1 line
1.8.3.1
PATCH 30/622 lustre: obd: create ping sysfs file
In reply to James SimmonsWe have ping in the lustre debugfs tree. Its a perfect fit for sysfs. Create a sysfs equivalent so we can in time remove the debugfs file.
WC-bug-id: https://jira.hpdd.intel.com/browse/LU-8066
Lustre-commit: 0100ab268c31 ("LU-8066 obd: final pieces for sysfs/debugfs support")
Reviewed-on: https://review.whamcloud.com/28108
Lustre-commit: 6bbae72c6900 ("LU-8066 sysfs: make ping sysfs file read and writable")
Reviewed-on: https://review.whamcloud.com/33776
--- fs/lustre/include/lprocfs_status.h | 6 ++++-- fs/lustre/mdc/lproc_mdc.c | 7 +++---- fs/lustre/mgc/lproc_mgc.c | 7 +++---- fs/lustre/osc/lproc_osc.c | 7 +++---- fs/lustre/ptlrpc/lproc_ptlrpc.c | 18 ++++++++---------- 5 files changed, 21 insertions(+), 24 deletions(-)
fs/lustre/include/lprocfs_status.h +4 -2
@@ -457,8 +457,10 @@ int lprocfs_wr_uint(struct file *file, const char __user *buffer,struct adaptive_timeout ;int lprocfs_at_hist_helper (struct seq_file *m,struct adaptive_timeout *at);int lprocfs_rd_timeouts (struct seq_file *m,void *data); -int lprocfs_wr_ping (struct file *file,const char __user *buffer, -size_t count,loff_t *off); + +ssize_t ping_show (struct kobject *kobj,struct attribute *attr, +char *buffer); +int lprocfs_wr_import (struct file *file,const char __user *buffer,size_t count,loff_t *off);int lprocfs_rd_pinger_recov (struct seq_file *m,void *n);
fs/lustre/mdc/lproc_mdc.c +3 -4
@@ -306,6 +306,8 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj,#define mdc_conn_uuid_show conn_uuid_showLUSTRE_RO_ATTR (mdc_conn_uuid); +LUSTRE_RO_ATTR (ping); +static ssize_t mdc_rpc_stats_seq_write (struct file *file,const char __user *buf,size_t len,loff_t *off)
@@ -454,8 +456,6 @@ static ssize_t mdc_stats_seq_write(struct file *file, }LPROC_SEQ_FOPS (mdc_stats); -LPROC_SEQ_FOPS_WR_ONLY (mdc, ping); -LPROC_SEQ_FOPS_RO_TYPE (mdc, connect_flags);LPROC_SEQ_FOPS_RO_TYPE (mdc, server_uuid);LPROC_SEQ_FOPS_RO_TYPE (mdc, timeouts);
@@ -465,8 +465,6 @@ static ssize_t mdc_stats_seq_write(struct file *file,LPROC_SEQ_FOPS_RW_TYPE (mdc, pinger_recov);static struct lprocfs_vars lprocfs_mdc_obd_vars[] = { - { .name ="ping" , - .fops = &mdc_ping_fops }, { .name ="connect_flags" , .fops = &mdc_connect_flags_fops }, { .name ="mds_server_uuid" ,
@@ -500,6 +498,7 @@ static ssize_t mdc_stats_seq_write(struct file *file, &lustre_attr_max_mod_rpcs_in_flight.attr, &lustre_attr_max_pages_per_rpc.attr, &lustre_attr_mdc_conn_uuid.attr, + &lustre_attr_ping.attr, NULL, };
fs/lustre/mgc/lproc_mgc.c +3 -4
@@ -45,8 +45,6 @@LPROC_SEQ_FOPS_RO_TYPE (mgc, state); -LPROC_SEQ_FOPS_WR_ONLY (mgc, ping); -static int mgc_ir_state_seq_show (struct seq_file *m,void *v) {return lprocfs_mgc_rd_ir_state (m, m->private);
@@ -55,8 +53,6 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void *v)LPROC_SEQ_FOPS_RO (mgc_ir_state);struct lprocfs_vars lprocfs_mgc_obd_vars[] = { - { .name ="ping" , - .fops = &mgc_ping_fops }, { .name ="connect_flags" , .fops = &mgc_connect_flags_fops }, { .name ="mgs_server_uuid" ,
@@ -73,8 +69,11 @@ struct lprocfs_vars lprocfs_mgc_obd_vars[] = {#define mgs_conn_uuid_show conn_uuid_showLUSTRE_RO_ATTR (mgs_conn_uuid); +LUSTRE_RO_ATTR (ping); +static struct attribute *mgc_attrs[] = { &lustre_attr_mgs_conn_uuid.attr, + &lustre_attr_ping.attr,NULL , };
fs/lustre/osc/lproc_osc.c +3 -4
@@ -176,6 +176,8 @@ static ssize_t max_dirty_mb_store(struct kobject *kobj,#define ost_conn_uuid_show conn_uuid_showLUSTRE_RO_ATTR (ost_conn_uuid); +LUSTRE_RO_ATTR (ping); +static int osc_cached_mb_seq_show (struct seq_file *m,void *v) {struct obd_device *dev = m->private;
@@ -601,14 +603,10 @@ static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)LPROC_SEQ_FOPS_RO_TYPE (osc, timeouts);LPROC_SEQ_FOPS_RO_TYPE (osc, state); -LPROC_SEQ_FOPS_WR_ONLY (osc, ping); -LPROC_SEQ_FOPS_RW_TYPE (osc, import);LPROC_SEQ_FOPS_RW_TYPE (osc, pinger_recov);static struct lprocfs_vars lprocfs_osc_obd_vars[] = { - { .name ="ping" , - .fops = &osc_ping_fops }, { .name ="connect_flags" , .fops = &osc_connect_flags_fops }, { .name ="ost_server_uuid" ,
@@ -812,6 +810,7 @@ void lproc_osc_attach_seqstat(struct obd_device *dev) &lustre_attr_short_io_bytes.attr, &lustre_attr_resend_count.attr, &lustre_attr_ost_conn_uuid.attr, + &lustre_attr_ping.attr, NULL, };
fs/lustre/ptlrpc/lproc_ptlrpc.c +8 -10
@@ -1227,13 +1227,11 @@ void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) }EXPORT_SYMBOL (ptlrpc_lprocfs_unregister_obd); -#undef BUFLEN - -int lprocfs_wr_ping (struct file *file,const char __user *buffer, -size_t count,loff_t *off) +ssize_t ping_show (struct kobject *kobj,struct attribute *attr, +char *buffer) { -struct seq_file *m = file->private_data; -struct obd_device *obd = m->private; + struct obd_device *obd = container_of(kobj, struct obd_device, + obd_kset.kobj);struct ptlrpc_request *req;int rc;
@@ -1249,13 +1247,13 @@ int lprocfs_wr_ping(struct file *file, const char __user *buffer, req->rq_send_state =LUSTRE_IMP_FULL ; rc =ptlrpc_queue_wait (req); -ptlrpc_req_finished (req); -if (rc >=0 ) -return count; +return rc; } -EXPORT_SYMBOL (lprocfs_wr_ping); +EXPORT_SYMBOL (ping_show); + +#undef BUFLEN/* Write the connection UUID to this file to attempt to connect to that node. * The connection UUID is a node's primary NID. For example,
Signature · 1 line
1.8.3.1
PATCH 31/622 lustre: ldlm: change LDLM_POOL_ADD_VAR macro to inline function
In reply to James SimmonsSimple cleanup to create inline funciton ldlm_pool_add_var().
WC-bug-id: https://jira.hpdd.intel.com/browse/LU-8066
Lustre-commit: 05a36534ba2d ("LU-8066 ldlm: move all remaining files from procfs to debugfs")
Reviewed-on: https://review.whamcloud.com/29255
WC-bug-id: https://jira.hpdd.intel.com/browse/LU-3319
Lustre-commit: 4ad445ccd54 ("LU-3319 procfs: move ldlm proc handling over to seq_file")
Reviewed-on: http://review.whamcloud.com/7293
--- fs/lustre/ldlm/ldlm_internal.h | 10 ++++++++++ fs/lustre/ldlm/ldlm_pool.c | 11 ++--------- 2 files changed, 12 insertions(+), 9 deletions(-)
fs/lustre/ldlm/ldlm_internal.h +10 -0
@@ -292,6 +292,16 @@ enum ldlm_policy_res { } \ struct __##var##__dummy_write {; } /* semicolon catcher */ +static inline void +ldlm_add_var (struct lprocfs_vars *vars,struct dentry *debugfs_entry, +const char *name,void *data,const struct file_operations *ops) +{ + vars->name = name; + vars->data = data; + vars->fops = ops; +ldebugfs_add_vars (debugfs_entry, vars,NULL ); +} +static inline int is_granted_or_cancelled (struct ldlm_lock *lock) {int ret =0 ;
fs/lustre/ldlm/ldlm_pool.c +2 -9
@@ -504,14 +504,6 @@ static ssize_t grant_speed_show(struct kobject *kobj, struct attribute *attr,LDLM_POOL_SYSFS_WRITER_NOLOCK_STORE (lock_volume_factor, atomic);LUSTRE_RW_ATTR (lock_volume_factor); -#define LDLM_POOL_ADD_VAR (_name, var, ops) \ - do { \ - pool_vars[0].name = #_name; \ - pool_vars[0].data = var; \ - pool_vars[0].fops = ops; \ - ldebugfs_add_vars(pl->pl_debugfs_entry, pool_vars, NULL);\ - } while (0) -/* These are for pools in /sys/fs/lustre/ldlm/namespaces/.../pool */ static struct attribute *ldlm_pl_attrs[] = { &lustre_attr_grant_speed.attr,
@@ -571,7 +563,8 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)memset (pool_vars,0 ,sizeof (pool_vars)); -LDLM_POOL_ADD_VAR (state, pl, &lprocfs_pool_state_fops); +ldlm_add_var (&pool_vars[0 ], pl->pl_debugfs_entry,"state" , pl, + &lprocfs_pool_state_fops); pl->pl_stats =lprocfs_alloc_stats (LDLM_POOL_LAST_STAT -LDLM_POOL_FIRST_STAT ,0 );
Signature · 1 line
1.8.3.1
PATCH 32/622 lustre: obdecho: use vmalloc for lnb
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
When allocating the niobuf_local, if there are a large number of (potential) fragments this allocation can be quite large. Use kvmalloc_array() and kvfree() to avoid allocation errors and console noise. This was causing sanity test_180c to fail in a VM on occasion, and could also be problem in real use.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10903
Lustre-commit: 8878bab7ae5f ("LU-10903 obdecho: use OBD_ALLOC_LARGE for lnb")
Reviewed-on: https://review.whamcloud.com/31964
--- fs/lustre/obdecho/echo_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/lustre/obdecho/echo_client.c +3 -2
@@ -1343,7 +1343,8 @@ static int echo_client_prep_commit(const struct lu_env *env, npages = batch >>PAGE_SHIFT ; tot_pages = count >>PAGE_SHIFT ; - lnb =kcalloc (npages,sizeof (struct niobuf_local ),GFP_NOFS ); + lnb =kvmalloc_array (npages,sizeof (struct niobuf_local ), +GFP_NOFS | __GFP_ZERO);if (!lnb) { ret = -ENOMEM ; goto out;
@@ -1411,7 +1412,7 @@ static int echo_client_prep_commit(const struct lu_env *env, } out: -kfree (lnb); +kvfree (lnb);return ret; }
Signature · 1 line
1.8.3.1
PATCH 33/622 lustre: mdc: deny layout swap for DoM file
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
Layout swap is prohibited for DoM files until LU-10177 will be implemented. The only exception is the new layout having the same DoM component.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10910
Lustre-commit: 51c11d7cfaff ("LU-10910 mdd: deny layout swap for DoM file")
Reviewed-on: https://review.whamcloud.com/32044
--- fs/lustre/mdc/mdc_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/lustre/mdc/mdc_dev.c +2 -1
@@ -149,7 +149,8 @@ struct ldlm_lock *mdc_dlmlock_at_pgoff(const struct lu_env *env,* writers can share a single PW lock. */ mode =mdc_dom_lock_match (env,osc_export (obj), resname,LDLM_IBITS , - policy,LCK_PR |LCK_PW , &flags, obj, &lockh, + policy,LCK_PR |LCK_PW |LCK_GROUP , &flags, + obj, &lockh, dap_flags &OSC_DAP_FL_CANCELING );if (mode) { lock =ldlm_handle2lock (&lockh);
Signature · 1 line
1.8.3.1
PATCH 34/622 lustre: mgc: remove obsolete IR swabbing workaround
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
The OBD_CONNECT_MNE_SWAB check was added to the MGC for compatibility with servers in the 2.2.0-2.2.55 range (in 2012) with big-endian clients. 2.2 was not an LTS release and is no longer being used.
Remove the checks on the client for OBD_CONNECT_MNE_SWAB being set, and assume that the server does not have this bug. This will allow the removal of the rest of this workaround from the server code once there are no more clients depending on the presence of this flag.
WC-bug-id: https://jira.whamcloud.com/browse/LU-1644
Lustre-commit: a0c644fde340 ("LU-1644 mgc: remove obsolete IR swabbing workaround")
Reviewed-on: https://review.whamcloud.com/32087
--- fs/lustre/include/lustre_import.h | 4 ---- fs/lustre/mgc/mgc_request.c | 9 +-------- fs/lustre/ptlrpc/import.c | 21 --------------------- 3 files changed, 1 insertion(+), 33 deletions(-)
fs/lustre/include/lustre_import.h +0 -4
@@ -289,10 +289,6 @@ struct obd_import { imp_resend_replay:1 ,/* disable normal recovery, for test only. */ imp_no_pinger_recover:1, -#if OBD_OCD_VERSION (3 ,0 ,53 ,0 ) >LUSTRE_VERSION_CODE -/* need IR MNE swab */ - imp_need_mne_swab:1, -#endif /* import must be reconnected instead of * chosing new connection */
fs/lustre/mgc/mgc_request.c +1 -8
@@ -1436,14 +1436,7 @@ static int mgc_process_recover_log(struct obd_device *obd, goto out; } - mne_swab = !!ptlrpc_rep_need_swab (req); -#if OBD_OCD_VERSION (3 ,0 ,53 ,0 ) >LUSTRE_VERSION_CODE -/* This import flag means the server did an extra swab of IR MNE -* records (fixed in LU-1252), reverse it here if needed. LU-1644 -*/ -if (unlikely (req->rq_import->imp_need_mne_swab)) - mne_swab = !mne_swab; -#endif + mne_swab =ptlrpc_rep_need_swab (req);for (i =0 ; i < nrpages && ealen >0 ; i++) {int rc2;
fs/lustre/ptlrpc/import.c +0 -21
@@ -780,27 +780,6 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp, warned = true; } -#if LUSTRE_VERSION_CODE <OBD_OCD_VERSION (3 ,0 ,53 ,0 ) -/* -* Check if server has LU-1252 fix applied to not always swab -* the IR MNE entries. Do this only once per connection. This -* fixup is version-limited, because we don't want to carry the -* OBD_CONNECT_MNE_SWAB flag around forever, just so long as we -* need interop with unpatched 2.2 servers. For newer servers, -* the client will do MNE swabbing only as needed. LU-1644 -*/ -if (unlikely ((ocd->ocd_connect_flags &OBD_CONNECT_VERSION ) && - !(ocd->ocd_connect_flags &OBD_CONNECT_MNE_SWAB ) && -OBD_OCD_VERSION_MAJOR (ocd->ocd_version) ==2 && -OBD_OCD_VERSION_MINOR (ocd->ocd_version) ==2 && -OBD_OCD_VERSION_PATCH (ocd->ocd_version) <55 && - !strcmp (imp->imp_obd->obd_type->typ_name, -LUSTRE_MGC_NAME ))) - imp->imp_need_mne_swab =1 ; -else /* clear if server was upgraded since last connect */ - imp->imp_need_mne_swab =0 ; -#endif -if (ocd->ocd_connect_flags &OBD_CONNECT_CKSUM ) {/* * We sent to the server ocd_cksum_types with bits set
Signature · 1 line
1.8.3.1
PATCH 35/622 lustre: ptlrpc: add dir migration connect flag
In reply to James SimmonsFrom: Lai Siyao <[email protected]>
Add dir migration connect flag to prevent collision with other features. Though dir migration code exists, it will be reworked, and the new RPC protocol won't be compatible with current one.
Also handle the previously-added OBD_CONNECT2_FLR flag.
WC-bug-id: https://jira.whamcloud.com/browse/LU-4684
Lustre-commit: 14b98596fa24 ("LU-4684 ptlrpc: add dir migration connect flag")
Reviewed-on: https://review.whamcloud.com/31914
--- fs/lustre/obdclass/lprocfs_status.c | 8 ++++++-- fs/lustre/ptlrpc/wiretest.c | 4 ++++ include/uapi/linux/lustre/lustre_idl.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-)
fs/lustre/obdclass/lprocfs_status.c +6 -2
@@ -111,8 +111,12 @@"compact_obdo" ,"second_flags" ,/* flags2 names */ -"file_secctx" , -"lockaheadv2" , +"file_secctx" ,/* 0x01 */ +"lockaheadv2" ,/* 0x02 */ +"dir_migrate" ,/* 0x04 */ +"unknown" ,/* 0x08 */ +"unknown" ,/* 0x10 */ +"flr" ,/* 0x20 */ NULL };
fs/lustre/ptlrpc/wiretest.c +4 -0
@@ -1111,6 +1111,10 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_FILE_SECCTX);LASSERTF (OBD_CONNECT2_LOCKAHEAD ==0x2ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_LOCKAHEAD ); +LASSERTF (OBD_CONNECT2_DIR_MIGRATE ==0x4ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_DIR_MIGRATE ); +LASSERTF (OBD_CONNECT2_FLR ==0x20ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_FLR );LASSERTF (OBD_CKSUM_CRC32 ==0x00000001UL ,"found 0x%.8xUL\n" , (unsigned int )OBD_CKSUM_CRC32 ); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +2 -0
@@ -791,6 +791,8 @@ struct ptlrpc_body_v2 {#define OBD_CONNECT2_LOCKAHEAD 0x2ULL/* ladvise lockahead * v2 */ +#define OBD_CONNECT2_DIR_MIGRATE 0x4ULL/* migrate striped dir +*/ #define OBD_CONNECT2_FLR 0x20ULL/* FLR support */ /* XXX README XXX:
Signature · 1 line
1.8.3.1
PATCH 36/622 lustre: mds: remove obsolete MDS_VTX_BYPASS flag
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
The MDS_VTX_BYPASS flag is only set and never checked. This is true since 2.3.53-66-g54fe979 "LU-2216 mdt: remove obsolete DNE code", but it was already obsolete for a long time before that.
WC-bug-id: https://jira.whamcloud.com/browse/LU-6349
Lustre-commit: b99344dda425 ("LU-6349 mds: remove obsolete MDS_VTX_BYPASS flag")
Reviewed-on: https://review.whamcloud.com/31984
--- fs/lustre/ptlrpc/wiretest.c | 2 -- include/uapi/linux/lustre/lustre_idl.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-)
fs/lustre/ptlrpc/wiretest.c +0 -2
@@ -1870,8 +1870,6 @@ void lustre_assert_wire_constants(void)LASSERTF (MDS_CROSS_REF ==0x00000002UL ,"found 0x%.8xUL\n" , (unsigned int )MDS_CROSS_REF ); -LASSERTF (MDS_VTX_BYPASS ==0x00000004UL ,"found 0x%.8xUL\n" , - (unsigned int )MDS_VTX_BYPASS );LASSERTF (MDS_PERM_BYPASS ==0x00000008UL ,"found 0x%.8xUL\n" , (unsigned int )MDS_PERM_BYPASS ); LASSERTF(MDS_QUOTA_IGNORE == 0x00000020UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +2 -2
@@ -1644,11 +1644,11 @@ struct mdt_rec_setattr {enum mds_op_bias {/* MDS_CHECK_SPLIT = 1 << 0, obsolete before 2.3.58 */ MDS_CROSS_REF =1 <<1 , -MDS_VTX_BYPASS =1 <<2 , +/* MDS_VTX_BYPASS = 1 << 2, obsolete since 2.3.54 */ MDS_PERM_BYPASS =1 <<3 ,/* MDS_SOM = 1 << 4, obsolete since 2.8.0 */ MDS_QUOTA_IGNORE =1 <<5 , -MDS_CLOSE_CLEANUP =1 <<6 , +/* MDS_CLOSE_CLEANUP = 1 << 6, obsolete since 2.3.51 */ MDS_KEEP_ORPHAN =1 <<7 ,MDS_RECOV_OPEN =1 <<8 ,MDS_DATA_MODIFIED =1 <<9 ,
Signature · 1 line
1.8.3.1
PATCH 37/622 lustre: ldlm: expose dirty age limit for flush-on-glimpse
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
Glimpse request may cancel old lock and cause data flush. That helps to cache stat results on client locally early. The time limit was hardcoded to 10s and is exposed now as ns_dirty_age_limit namespace value, it can be set/check via /sys/fs/lustre/ldlm/namespaces/<namespace>/dirty_age_limit
WC-bug-id: https://jira.whamcloud.com/browse/LU-10413
Lustre-commit: 69727e45b4c0 ("LU-10413 ldlm: expose dirty age limit for flush-on-glimpse")
Reviewed-on: https://review.whamcloud.com/32113
--- fs/lustre/include/lustre_dlm.h | 12 +++++++++++- fs/lustre/ldlm/ldlm_lockd.c | 2 +- fs/lustre/ldlm/ldlm_resource.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-)
fs/lustre/include/lustre_dlm.h +11 -1
@@ -60,6 +60,10 @@#define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus())#define LDLM_DEFAULT_MAX_ALIVE (64 * 60)/* 65 min */ +/* if client lock is unused for that time it can be cancelled if any other +* client shows interest in that lock, e.g. glimpse is occurred. +*/ +#define LDLM_DIRTY_AGE_LIMIT (10)#define LDLM_DEFAULT_PARALLEL_AST_LIMIT 1024/**
@@ -412,7 +416,13 @@ struct ldlm_namespace {/** Maximum allowed age (last used time) for locks in the LRU */ ktime_t ns_max_age; - +/** +* Number of seconds since the lock was last used. The client may +* cancel the lock limited by this age and flush related data if +* any other client shows interest in it doing glimpse request. +* This allows to cache stat data locally for such files early. +*/ +time64_t ns_dirty_age_limit;/** * Used to rate-limit ldlm_namespace_dump calls. * \see ldlm_namespace_dump. Increased by 10 seconds every time
fs/lustre/ldlm/ldlm_lockd.c +1 -1
@@ -305,7 +305,7 @@ static void ldlm_handle_gl_callback(struct ptlrpc_request *req, !lock->l_readers && !lock->l_writers && ktime_after(ktime_get(), ktime_add(lock->l_last_used, - ktime_set(10, 0)))) { + ktime_set(ns->ns_dirty_age_limit, 0)))) {unlock_res_and_lock (lock);if (ldlm_bl_to_thread_lock (ns,NULL , lock))ldlm_handle_bl_callback (ns,NULL , lock);
fs/lustre/ldlm/ldlm_resource.c +28 -0
@@ -327,6 +327,32 @@ static ssize_t early_lock_cancel_store(struct kobject *kobj, }LUSTRE_RW_ATTR (early_lock_cancel); +static ssize_t dirty_age_limit_show (struct kobject *kobj, +struct attribute *attr,char *buf) +{ + struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace, + ns_kobj); + +return sprintf (buf,"%llu\n" , ns->ns_dirty_age_limit); +} + +static ssize_t dirty_age_limit_store (struct kobject *kobj, +struct attribute *attr, +const char *buffer,size_t count) +{ + struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace, + ns_kobj); +unsigned long long tmp; + +if (kstrtoull (buffer,10 , &tmp)) +return -EINVAL ; + + ns->ns_dirty_age_limit = tmp; + +return count; +} +LUSTRE_RW_ATTR (dirty_age_limit); +/* These are for namespaces in /sys/fs/lustre/ldlm/namespaces/ */ static struct attribute *ldlm_ns_attrs[] = { &lustre_attr_resource_count.attr,
@@ -335,6 +361,7 @@ static ssize_t early_lock_cancel_store(struct kobject *kobj, &lustre_attr_lru_size.attr, &lustre_attr_lru_max_age.attr, &lustre_attr_early_lock_cancel.attr, + &lustre_attr_dirty_age_limit.attr, NULL, };
@@ -653,6 +680,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, ns->ns_max_age =ktime_set (LDLM_DEFAULT_MAX_ALIVE ,0 ); ns->ns_orig_connect_flags =0 ; ns->ns_connect_flags =0 ; + ns->ns_dirty_age_limit =LDLM_DIRTY_AGE_LIMIT ; ns->ns_stopping =0 ; rc =ldlm_namespace_sysfs_register (ns);
Signature · 1 line
1.8.3.1
PATCH 38/622 lustre: ldlm: IBITS lock convert instead of cancel
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
For IBITS lock it is possible to drop just conflicting bits and keep lock itself instead of cancelling it. Lock convert is only bits downgrade on client and then on server.
Patch implements lock convert during blocking AST.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10175
Lustre-commit: 37932c4beb98 ("LU-10175 ldlm: IBITS lock convert instead of cancel")
Reviewed-on: https://review.whamcloud.com/30202
--- fs/lustre/include/lustre_dlm.h | 6 + fs/lustre/include/lustre_dlm_flags.h | 16 +- fs/lustre/ldlm/ldlm_inodebits.c | 92 +++++++- fs/lustre/ldlm/ldlm_internal.h | 2 + fs/lustre/ldlm/ldlm_lock.c | 13 +- fs/lustre/ldlm/ldlm_lockd.c | 18 ++ fs/lustre/ldlm/ldlm_request.c | 198 ++++++++++++++++- fs/lustre/llite/namei.c | 383 ++++++++++++++++++++------------- fs/lustre/ptlrpc/wiretest.c | 2 +- include/uapi/linux/lustre/lustre_idl.h | 1 + 10 files changed, 569 insertions(+), 162 deletions(-)
fs/lustre/include/lustre_dlm.h +6 -0
@@ -544,6 +544,7 @@ enum ldlm_cancel_flags {LCF_BL_AST =0x4 ,/* Cancel locks marked as LDLM_FL_BL_AST * in the same RPC */ + LCF_CONVERT = 0x8, /* Try to convert IBITS lock before cancel */ }; struct ldlm_flock {
@@ -1306,6 +1307,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,enum ldlm_mode mode, u64 *flags, void *lvb, u32 lvb_len, const struct lustre_handle *lockh, int rc); +int ldlm_cli_convert (struct ldlm_lock *lock,u32 *flags);int ldlm_cli_update_pool (struct ptlrpc_request *req);int ldlm_cli_cancel (const struct lustre_handle *lockh,enum ldlm_cancel_flags cancel_flags);
@@ -1330,6 +1332,10 @@ int ldlm_cli_cancel_list(struct list_head *head, int count, enum ldlm_cancel_flags flags);/** @} ldlm_cli_api */ +int ldlm_inodebits_drop (struct ldlm_lock *lock,u64 to_drop); +int ldlm_cli_dropbits (struct ldlm_lock *lock,u64 drop_bits); +int ldlm_cli_dropbits_list (struct list_head *converts,u64 drop_bits); +/* mds/handler.c */ /* This has to be here because recursive inclusion sucks. */ int intent_disposition (struct ldlm_reply *rep,int flag);
fs/lustre/include/lustre_dlm_flags.h +13 -3
@@ -26,10 +26,10 @@*/ #ifndef LDLM_ALL_FLAGS_MASK -/** l_flags bits marked as "all_flags" bits */ -#define LDLM_FL_ALL_FLAGS_MASK 0x00FFFFFFC08F932FULL +/* l_flags bits marked as "all_flags" bits */ +#define LDLM_FL_ALL_FLAGS_MASK 0x00FFFFFFC28F932FULL -/** extent, mode, or resource changed */ +/* extent, mode, or resource changed */ #define LDLM_FL_LOCK_CHANGED 0x0000000000000001ULL/* bit 0 */ #define ldlm_is_lock_changed (_l) LDLM_TEST_FLAG((_l), 1ULL << 0)#define ldlm_set_lock_changed (_l) LDLM_SET_FLAG((_l), 1ULL << 0)
@@ -146,6 +146,16 @@#define ldlm_clear_cancel_on_block (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 23)/** +* Flag indicates that lock is being converted (downgraded) during the blocking +* AST instead of cancelling. Used for IBITS locks now and drops conflicting +* bits only keepeing other. +*/ +#define LDLM_FL_CONVERTING 0x0000000002000000ULL/* bit 25 */ +#define ldlm_is_converting (_l) LDLM_TEST_FLAG((_l), 1ULL << 25) +#define ldlm_set_converting (_l) LDLM_SET_FLAG((_l), 1ULL << 25) +#define ldlm_clear_converting (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 25) + +/* * Part of original lockahead implementation, OBD_CONNECT_LOCKAHEAD_OLD. * Reserved temporarily to allow those implementations to keep working. * Will be removed after 2.12 release.
fs/lustre/ldlm/ldlm_inodebits.c +91 -1
101 lines not on this page · raw message
fs/lustre/ldlm/ldlm_internal.h +2 -0
@@ -153,7 +153,9 @@ int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,#define ldlm_lock_remove_from_lru (lock) \ ldlm_lock_remove_from_lru_check(lock, ktime_set(0, 0))int ldlm_lock_remove_from_lru_nolock (struct ldlm_lock *lock); +void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock);void ldlm_lock_destroy_nolock (struct ldlm_lock *lock); +void ldlm_grant_lock_with_skiplist (struct ldlm_lock *lock);/* ldlm_lockd.c */ int ldlm_bl_to_thread_lock(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
fs/lustre/ldlm/ldlm_lock.c +11 -2
@@ -241,7 +241,7 @@ int ldlm_lock_remove_from_lru_check(struct ldlm_lock *lock, ktime_t last_use)/** * Adds LDLM lock @lock to namespace LRU. Assumes LRU is already locked. */ -static void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock) +void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);
@@ -791,7 +791,8 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, enum ldlm_mode mode) ldlm_bl_to_thread_lock(ns, NULL, lock) != 0)ldlm_handle_bl_callback (ns,NULL , lock); }else if (!lock->l_readers && !lock->l_writers && - !ldlm_is_no_lru (lock) && !ldlm_is_bl_ast (lock)) { + !ldlm_is_no_lru (lock) && !ldlm_is_bl_ast (lock) && + !ldlm_is_converting (lock)) {LDLM_DEBUG (lock,"add lock into lru list" );/* If this is a client-side namespace and this was the last
@@ -1648,6 +1649,13 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,unlock_res_and_lock (lock);ldlm_lock2desc (lock->l_blocking_lock, &d); +/* copy blocking lock ibits in cancel_bits as well, +* new client may use them for lock convert and it is +* important to use new field to convert locks from +* new servers only +*/ + d.l_policy_data.l_inodebits.cancel_bits = + lock->l_blocking_lock->l_policy_data.l_inodebits.bits; rc = lock->l_blocking_ast (lock, &d, (void *)arg,LDLM_CB_BLOCKING );LDLM_LOCK_RELEASE (lock->l_blocking_lock);
@@ -1896,6 +1904,7 @@ void ldlm_lock_cancel(struct ldlm_lock *lock)*/ if (lock->l_readers || lock->l_writers) {LDLM_ERROR (lock,"lock still has references" ); +unlock_res_and_lock (lock);LBUG (); }
fs/lustre/ldlm/ldlm_lockd.c +18 -0
@@ -118,6 +118,24 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns,LDLM_DEBUG (lock,"client blocking AST callback handler" );lock_res_and_lock (lock); + +/* set bits to cancel for this lock for possible lock convert */ +if (lock->l_resource->lr_type ==LDLM_IBITS ) { +/* Lock description contains policy of blocking lock, +* and its cancel_bits is used to pass conflicting bits. +* NOTE: ld can be NULL or can be not NULL but zeroed if +* passed from ldlm_bl_thread_blwi(), check below used bits +* in ld to make sure it is valid description. +*/ +if (ld && ld->l_policy_data.l_inodebits.bits) + lock->l_policy_data.l_inodebits.cancel_bits = + ld->l_policy_data.l_inodebits.cancel_bits; +/* if there is no valid ld and lock is cbpending already +* then cancel_bits should be kept, otherwise it is zeroed. +*/ +else if (!ldlm_is_cbpending (lock)) + lock->l_policy_data.l_inodebits.cancel_bits =0 ; + }ldlm_set_cbpending (lock);if (ldlm_is_cancel_on_block (lock))
fs/lustre/ldlm/ldlm_request.c +196 -2
228 lines not on this page · raw message
fs/lustre/llite/namei.c +230 -153
414 lines not on this page · raw message
fs/lustre/ptlrpc/wiretest.c +1 -1
@@ -3027,7 +3027,7 @@ void lustre_assert_wire_constants(void) (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));/* Checks for struct ldlm_inodebits */ -LASSERTF ((int )sizeof (struct ldlm_inodebits ) ==8 ,"found %lld\n" , +LASSERTF ((int )sizeof (struct ldlm_inodebits ) ==16 ,"found %lld\n" , (long long )(int )sizeof (struct ldlm_inodebits ));LASSERTF ((int )offsetof(struct ldlm_inodebits , bits) ==0 ,"found %lld\n" , (long long )(int )offsetof(struct ldlm_inodebits , bits));
include/uapi/linux/lustre/lustre_idl.h +1 -0
@@ -2120,6 +2120,7 @@ static inline bool ldlm_extent_equal(const struct ldlm_extent *ex1,struct ldlm_inodebits {__u64 bits; +__u64 cancel_bits;/* for lock convert */ };struct ldlm_flock_wire {
Signature · 1 line
1.8.3.1
PATCH 39/622 lustre: ptlrpc: fix return type of boolean functions
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Some functions are returning type int with values 0 or 1 when they could be returning bool. Fix up the return type of:
lustre_req_swabbed()
lustre_rep_swabbed()
ptlrpc_req_need_swab()
ptlrpc_rep_need_swab()
ptlrpc_buf_need_swab()
WC-bug-id: https://jira.whamcloud.com/browse/LU-1644
Lustre-commit: e2cac9fb9baf ("LU-1644 ptlrpc: fix return type of boolean functions")
Reviewed-on: https://review.whamcloud.com/32088
--- fs/lustre/include/lustre_net.h | 20 ++++++++++---------- fs/lustre/ptlrpc/pack_generic.c | 9 ++++----- fs/lustre/ptlrpc/sec_plain.c | 7 +++---- 3 files changed, 17 insertions(+), 19 deletions(-)
fs/lustre/include/lustre_net.h +10 -10
@@ -953,35 +953,35 @@ static inline bool ptlrpc_nrs_req_can_move(struct ptlrpc_request *req)/** @} nrs */ /** -* Returns 1 if request buffer at offset @index was already swabbed +* Returns true if request buffer at offset @index was already swabbed */ -static inline int lustre_req_swabbed (struct ptlrpc_request *req,size_t index) +static inline bool lustre_req_swabbed (struct ptlrpc_request *req,size_t index) {LASSERT (index <sizeof (req->rq_req_swab_mask) *8 );return req->rq_req_swab_mask & (1 << index); }/** -* Returns 1 if request reply buffer at offset @index was already swabbed +* Returns true if request reply buffer@offset @index was already swabbed */ -static inline int lustre_rep_swabbed (struct ptlrpc_request *req,size_t index) +static inline bool lustre_rep_swabbed (struct ptlrpc_request *req,size_t index) {LASSERT (index <sizeof (req->rq_rep_swab_mask) *8 );return req->rq_rep_swab_mask & (1 << index); }/** -* Returns 1 if request needs to be swabbed into local cpu byteorder +* Returns true if request needs to be swabbed into local cpu byteorder */ -static inline int ptlrpc_req_need_swab (struct ptlrpc_request *req) +static inline bool ptlrpc_req_need_swab (struct ptlrpc_request *req) {return lustre_req_swabbed (req,MSG_PTLRPC_HEADER_OFF ); }/** -* Returns 1 if request reply needs to be swabbed into local cpu byteorder +* Returns true if request reply needs to be swabbed into local cpu byteorder */ -static inline int ptlrpc_rep_need_swab (struct ptlrpc_request *req) +static inline bool ptlrpc_rep_need_swab (struct ptlrpc_request *req) {return lustre_rep_swabbed (req,MSG_PTLRPC_HEADER_OFF ); }
@@ -1999,8 +1999,8 @@ struct ptlrpc_service *ptlrpc_register_service(struct ptlrpc_service_conf *conf,* * @{ */ -int ptlrpc_buf_need_swab (struct ptlrpc_request *req,const int inout, -u32 index); +bool ptlrpc_buf_need_swab (struct ptlrpc_request *req,const int inout, +u32 index);void ptlrpc_buf_set_swabbed (struct ptlrpc_request *req,const int inout,u32 index);int ptlrpc_unpack_rep_msg (struct ptlrpc_request *req,int len);
fs/lustre/ptlrpc/pack_generic.c +4 -5
@@ -78,15 +78,14 @@ void ptlrpc_buf_set_swabbed(struct ptlrpc_request *req, const int inout,lustre_set_rep_swabbed (req, index); } -int ptlrpc_buf_need_swab (struct ptlrpc_request *req,const int inout, -u32 index) +bool ptlrpc_buf_need_swab (struct ptlrpc_request *req,const int inout, +u32 index) {if (inout)return (ptlrpc_req_need_swab (req) && !lustre_req_swabbed (req, index)); -else -return (ptlrpc_rep_need_swab (req) && - !lustre_rep_swabbed (req, index)); + +return (ptlrpc_rep_need_swab (req) && !lustre_rep_swabbed (req, index)); }/* early reply size */
fs/lustre/ptlrpc/sec_plain.c +3 -4
@@ -217,7 +217,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)struct lustre_msg *msg = req->rq_repdata;struct plain_header *phdr;u32 cksum; -int swabbed; +bool swabbed;if (msg->lm_bufcount !=PLAIN_PACK_SEGMENTS ) {CERROR ("unexpected reply buf count %u\n" , msg->lm_bufcount);
@@ -715,12 +715,11 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec, .sc_policy = &plain_policy, }; -static -int plain_accept (struct ptlrpc_request *req) +static int plain_accept (struct ptlrpc_request *req) {struct lustre_msg *msg = req->rq_reqbuf;struct plain_header *phdr; -int swabbed; +bool swabbed;LASSERT (SPTLRPC_FLVR_POLICY (req->rq_flvr.sf_rpc) ==SPTLRPC_POLICY_PLAIN );
Signature · 1 line
1.8.3.1
PATCH 40/622 lustre: llite: decrease sa_running if fail to start statahead
In reply to James SimmonsFrom: Fan Yong <[email protected]>
Otherwise the counter of ll_sb_info::ll_sa_running will leak as to the umount process will be blocked for ever.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10992
Lustre-commit: 6b8638bf7920 ("LU-10992 llite: decrease sa_running if fail to start statahead")
Reviewed-on: https://review.whamcloud.com/32287
--- fs/lustre/llite/statahead.c | 1 + 1 file changed, 1 insertion(+)
fs/lustre/llite/statahead.c +1 -0
@@ -1566,6 +1566,7 @@ static int start_statahead_thread(struct inode *dir, struct dentry *dentry)spin_lock (&lli->lli_sa_lock); lli->lli_sai =NULL ;spin_unlock (&lli->lli_sa_lock); +atomic_dec (&ll_i2sbi (parent->d_inode)->ll_sa_running); rc =PTR_ERR (task);CERROR ("can't start ll_sa thread, rc : %d\n" , rc); goto out;
Signature · 1 line
1.8.3.1
PATCH 41/622 lustre: lmv: dir page is released while in use
In reply to James SimmonsFrom: Lai Siyao <[email protected]>
When popping stripe dirent, if it reaches page end, stripe_dirent_next() releases current page and then reads next one, but current dirent is still in use, as will cause wrong values used, and trigger assertion.
This patch changes to not read next page upon reaching end, but leave it to next dirent read.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9857
Lustre-commit: b51e8d6b53a3 ("LU-9857 lmv: dir page is released while in use")
Reviewed-on: https://review.whamcloud.com/32180
--- fs/lustre/lmv/lmv_obd.c | 123 +++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 63 deletions(-)
fs/lustre/lmv/lmv_obd.c +60 -63
@@ -2016,7 +2016,7 @@ struct lmv_dir_ctxt {struct stripe_dirent ldc_stripes[0 ]; }; -static inline void put_stripe_dirent (struct stripe_dirent *stripe) +static inline void stripe_dirent_unload (struct stripe_dirent *stripe) {if (stripe->sd_page) {kunmap (stripe->sd_page);
@@ -2031,62 +2031,77 @@ static inline void put_lmv_dir_ctxt(struct lmv_dir_ctxt *ctxt)int i;for (i =0 ; i < ctxt->ldc_count; i++) -put_stripe_dirent (&ctxt->ldc_stripes[i]); +stripe_dirent_unload (&ctxt->ldc_stripes[i]); } -static struct lu_dirent *stripe_dirent_next (struct lmv_dir_ctxt *ctxt, +/* if @ent is dummy, or . .., get next */ +static struct lu_dirent *stripe_dirent_get (struct lmv_dir_ctxt *ctxt, +struct lu_dirent *ent, +int stripe_index) +{ +for (; ent; ent =lu_dirent_next (ent)) { +/* Skip dummy entry */ +if (le16_to_cpu (ent->lde_namelen) ==0 ) +continue ; + +/* skip . and .. for other stripes */ +if (stripe_index && + (strncmp (ent->lde_name,"." , +le16_to_cpu (ent->lde_namelen)) ==0 || +strncmp (ent->lde_name,".." , +le16_to_cpu (ent->lde_namelen)) ==0 )) +continue ; + +if (le64_to_cpu (ent->lde_hash) >= ctxt->ldc_hash) +break ; + } + +return ent; +} + +static struct lu_dirent *stripe_dirent_load (struct lmv_dir_ctxt *ctxt,struct stripe_dirent *stripe,int stripe_index) { +struct md_op_data *op_data = ctxt->ldc_op_data; +struct lmv_oinfo *oinfo; +struct lu_fid fid = op_data->op_fid1; +struct inode *inode = op_data->op_data; +struct lmv_tgt_desc *tgt;struct lu_dirent *ent = stripe->sd_ent;u64 hash = ctxt->ldc_hash; -u64 end;int rc =0 ;LASSERT (stripe == &ctxt->ldc_stripes[stripe_index]); - -if (stripe->sd_eof) -return NULL ; - -if (ent) { - ent =lu_dirent_next (ent); -if (!ent) { -check_eof: - end =le64_to_cpu (stripe->sd_dp->ldp_hash_end); - -LASSERTF (hash <= end,"hash %llx end %llx\n" , - hash, end); +LASSERT (!ent); + + do { + if (stripe->sd_page) { + u64 end = le64_to_cpu(stripe->sd_dp->ldp_hash_end); + + /* @hash should be the last dirent hash */ + LASSERTF(hash <= end, + "ctxt@%p stripe@%p hash %llx end %llx\n", + ctxt, stripe, hash, end); + /* unload last page */ + stripe_dirent_unload(stripe); + /* eof */ if (end == MDS_DIR_END_OFF) { stripe->sd_ent = NULL; stripe->sd_eof = true; -return NULL ; + break; } - -put_stripe_dirent (stripe); hash = end; } - } - -if (!ent) { -struct md_op_data *op_data = ctxt->ldc_op_data; -struct lmv_oinfo *oinfo; -struct lu_fid fid = op_data->op_fid1; -struct inode *inode = op_data->op_data; -struct lmv_tgt_desc *tgt; - -LASSERT (!stripe->sd_page); oinfo = &op_data->op_mea1->lsm_md_oinfo[stripe_index]; tgt = lmv_get_target(ctxt->ldc_lmv, oinfo->lmo_mds, NULL); if (IS_ERR(tgt)) { rc = PTR_ERR(tgt); - goto out; + break; } -/* -* op_data will be shared by each stripe, so we need -* reset these value for each stripe -*/ + /* op_data is shared by stripes, reset after use */ op_data->op_fid1 = oinfo->lmo_fid; op_data->op_fid2 = oinfo->lmo_fid; op_data->op_data = oinfo->lmo_root;
@@ -2099,42 +2114,24 @@ static struct lu_dirent *stripe_dirent_next(struct lmv_dir_ctxt *ctxt, op_data->op_data = inode;if (rc) - goto out; - - stripe->sd_dp =page_address (stripe->sd_page); - ent =lu_dirent_start (stripe->sd_dp); - } - -for (; ent; ent =lu_dirent_next (ent)) { -/* Skip dummy entry */ -if (!le16_to_cpu (ent->lde_namelen)) -continue ; - -/* skip . and .. for other stripes */ -if (stripe_index && - (strncmp (ent->lde_name,"." , -le16_to_cpu (ent->lde_namelen)) ==0 || -strncmp (ent->lde_name,".." , -le16_to_cpu (ent->lde_namelen)) ==0 )) -continue ; - -if (le64_to_cpu (ent->lde_hash) >= hash)break ; - } -if (!ent) - goto check_eof; + stripe->sd_dp =page_address (stripe->sd_page); + ent =stripe_dirent_get (ctxt,lu_dirent_start (stripe->sd_dp), + stripe_index); +/* in case a page filled with ., .. and dummy, read next */ + }while (!ent); -out: stripe->sd_ent = ent; -/* treat error as eof, so dir can be partially accessed */ if (rc) { -put_stripe_dirent (stripe); +LASSERT (!ent); +/* treat error as eof, so dir can be partially accessed */ stripe->sd_eof = true;LCONSOLE_WARN ("dir " DFID " stripe %d readdir failed: %d, directory is partially accessed!\n" ,PFID (&ctxt->ldc_op_data->op_fid1), stripe_index, rc); } +return ent; }
@@ -2186,8 +2183,7 @@ static struct lu_dirent *lmv_dirent_next(struct lmv_dir_ctxt *ctxt)continue ;if (!stripe->sd_ent) { -/* locate starting entry */ -stripe_dirent_next (ctxt, stripe, i); +stripe_dirent_load (ctxt, stripe, i);if (!stripe->sd_ent) {LASSERT (stripe->sd_eof);continue ;
@@ -2208,7 +2204,8 @@ static struct lu_dirent *lmv_dirent_next(struct lmv_dir_ctxt *ctxt) stripe = &ctxt->ldc_stripes[min]; ent = stripe->sd_ent;/* pop found dirent */ -stripe_dirent_next (ctxt, stripe, min); + stripe->sd_ent =stripe_dirent_get (ctxt,lu_dirent_next (ent), + min); }return ent;
Signature · 1 line
1.8.3.1
PATCH 42/622 lustre: ldlm: speed up preparation for list of lock cancel
In reply to James SimmonsFrom: Yang Sheng <[email protected]>
Keep the skipped locks in lru list will cause serious contention for ns_lock. Since we have to travel them every time in the ldlm_prepare_lru_list(). So we will use a cursor to record position that last accessed lock in lru list.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9230
Lustre-commit: 651f2cdd2d8d ("LU-9230 ldlm: speed up preparation for list of lock cancel")
Reviewed-on: https://review.whamcloud.com/26327
--- fs/lustre/include/lustre_dlm.h | 1 + fs/lustre/include/lustre_dlm_flags.h | 9 ----- fs/lustre/ldlm/ldlm_lock.c | 3 +- fs/lustre/ldlm/ldlm_request.c | 72 ++++++++++++++++-------------------- fs/lustre/ldlm/ldlm_resource.c | 1 + 5 files changed, 35 insertions(+), 51 deletions(-)
fs/lustre/include/lustre_dlm.h +1 -0
@@ -406,6 +406,7 @@ struct ldlm_namespace {struct list_head ns_unused_list;/** Number of locks in the LRU list above */ int ns_nr_unused; +struct list_head *ns_last_pos;/** * Maximum number of locks permitted in the LRU. If 0, means locks
fs/lustre/include/lustre_dlm_flags.h +0 -9
@@ -200,15 +200,6 @@#define ldlm_set_fail_loc (_l) LDLM_SET_FLAG((_l), 1ULL << 32)#define ldlm_clear_fail_loc (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 32) -/** -* Used while processing the unused list to know that we have already -* handled this lock and decided to skip it. -*/ -#define LDLM_FL_SKIPPED 0x0000000200000000ULL/* bit 33 */ -#define ldlm_is_skipped (_l) LDLM_TEST_FLAG((_l), 1ULL << 33) -#define ldlm_set_skipped (_l) LDLM_SET_FLAG((_l), 1ULL << 33) -#define ldlm_clear_skipped (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 33) -/** this lock is being destroyed */ #define LDLM_FL_CBPENDING 0x0000000400000000ULL/* bit 34 */ #define ldlm_is_cbpending (_l) LDLM_TEST_FLAG((_l), 1ULL << 34)
fs/lustre/ldlm/ldlm_lock.c +2 -1
@@ -204,6 +204,8 @@ int ldlm_lock_remove_from_lru_nolock(struct ldlm_lock *lock)struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);LASSERT (lock->l_resource->lr_type !=LDLM_FLOCK ); +if (ns->ns_last_pos == &lock->l_lru) + ns->ns_last_pos = lock->l_lru.prev;list_del_init (&lock->l_lru);LASSERT (ns->ns_nr_unused >0 ); ns->ns_nr_unused--;
@@ -249,7 +251,6 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock)LASSERT (list_empty (&lock->l_lru));LASSERT (lock->l_resource->lr_type !=LDLM_FLOCK );list_add_tail (&lock->l_lru, &ns->ns_unused_list); -ldlm_clear_skipped (lock);LASSERT (ns->ns_nr_unused >=0 ); ns->ns_nr_unused++; }
fs/lustre/ldlm/ldlm_request.c +31 -41
131 lines not on this page · raw message
fs/lustre/ldlm/ldlm_resource.c +1 -0
@@ -682,6 +682,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, ns->ns_connect_flags =0 ; ns->ns_dirty_age_limit =LDLM_DIRTY_AGE_LIMIT ; ns->ns_stopping =0 ; + ns->ns_last_pos = &ns->ns_unused_list; rc =ldlm_namespace_sysfs_register (ns);if (rc !=0 ) {
Signature · 1 line
1.8.3.1
PATCH 43/622 lustre: checksum: enable/disable checksum correctly
In reply to James SimmonsFrom: Emoly Liu <[email protected]>
There are three ways to set checksum support in Lustre. Their order during client mount is:
- 1. configure --enable/disable-checksum, this(ENABLE_CHECKSUM) only affects the default mount option and is set in function client_obd_setup().
- 2. lctl set_param -P osc.*.checksums=0/1, when processing llog, this value will be set by osc_checksum_seq_write().
- 3. mount option checksum/nochecksum, this will be checked in ll_options() and be set in client_common_fill_super()-> obd_set_info_async().
This patch fixes one issue in 3. That is if mount option "-o checksum/nochecksum" is specified, checksum will be changed accordingly, no matter what is set by "set_param -P" or the default option; and if no mount option is specified, the value set by "set_param -P" will be kept. Also, test_77k is added to sanity.sh to verify this patch.
What's more, a minor initialization issue of cl_supp_cksum_types is fixed. cl_supp_cksum_types should be always initialized no matter checksum is enabled or not.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10906
Lustre-commit: e9b13cd1daf9 ("LU-10906 checksum: enable/disable checksum correctly")
Reviewed-on: https://review.whamcloud.com/32095
--- fs/lustre/ldlm/ldlm_lib.c | 5 +++-- fs/lustre/llite/llite_internal.h | 3 ++- fs/lustre/llite/llite_lib.c | 23 ++++++++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-)
fs/lustre/ldlm/ldlm_lib.c +3 -2
@@ -355,6 +355,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)init_waitqueue_head (&cli->cl_destroy_waitq);atomic_set (&cli->cl_destroy_in_flight,0 ); + + cli->cl_supp_cksum_types =OBD_CKSUM_CRC32 ;/* Turn on checksumming by default. */ cli->cl_checksum =1 ;/*
@@ -362,8 +364,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)* Set cl_chksum* to CRC32 for now to avoid returning screwed info * through procfs. */ - cli->cl_cksum_type =OBD_CKSUM_CRC32 ; - cli->cl_supp_cksum_types =OBD_CKSUM_CRC32 ; + cli->cl_cksum_type = cli->cl_supp_cksum_types;atomic_set (&cli->cl_resends,OSC_DEFAULT_RESENDS );/*
fs/lustre/llite/llite_internal.h +2 -1
@@ -479,7 +479,8 @@ struct ll_sb_info { unsigned int ll_umounting:1, ll_xattr_cache_enabled:1, ll_xattr_cache_set:1, /* already set to 0/1 */ - ll_client_common_fill_super_succeeded:1; + ll_client_common_fill_super_succeeded:1, + ll_checksum_set:1;struct lustre_client_ocd ll_lco;
fs/lustre/llite/llite_lib.c +14 -9
@@ -560,13 +560,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) } checksum = sbi->ll_flags &LL_SBI_CHECKSUM ; - err =obd_set_info_async (NULL , sbi->ll_dt_exp,sizeof (KEY_CHECKSUM ), -KEY_CHECKSUM ,sizeof (checksum), &checksum, -NULL ); -if (err) { -CERROR ("%s: Set checksum failed: rc = %d\n" , - sbi->ll_dt_exp->exp_obd->obd_name, err); - goto out_root; +if (sbi->ll_checksum_set) { + err =obd_set_info_async (NULL , sbi->ll_dt_exp, +sizeof (KEY_CHECKSUM ),KEY_CHECKSUM , +sizeof (checksum), &checksum,NULL ); +if (err) { +CERROR ("%s: Set checksum failed: rc = %d\n" , + sbi->ll_dt_exp->exp_obd->obd_name, err); + goto out_root; + } }cl_sb_init (sb);
@@ -763,10 +765,11 @@ static inline int ll_set_opt(const char *opt, char *data, int fl) }/* non-client-specific mount options are parsed in lmd_parse */ -static int ll_options (char *options,int *flags) +static int ll_options (char *options,struct ll_sb_info *sbi) {int tmp;char *s1 = options, *s2; +int *flags = &sbi->ll_flags;if (!options)return 0 ;
@@ -832,11 +835,13 @@ static int ll_options(char *options, int *flags) tmp =ll_set_opt ("checksum" , s1,LL_SBI_CHECKSUM );if (tmp) { *flags |= tmp; + sbi->ll_checksum_set =1 ; goto next; } tmp =ll_set_opt ("nochecksum" , s1,LL_SBI_CHECKSUM );if (tmp) { *flags &= ~tmp; + sbi->ll_checksum_set =1 ; goto next; } tmp =ll_set_opt ("lruresize" , s1,LL_SBI_LRU_RESIZE );
@@ -971,7 +976,7 @@ int ll_fill_super(struct super_block *sb) goto out_free; } - err =ll_options (lsi->lsi_lmd->lmd_opts, &sbi->ll_flags); + err =ll_options (lsi->lsi_lmd->lmd_opts, sbi);if (err) goto out_free;
Signature · 1 line
1.8.3.1
PATCH 44/622 lustre: build: armv7 client build fixes
In reply to James SimmonsFrom: Andrew Perepechko <[email protected]>
This commit is supposed to fix armv7 Lustre client build, mostly 64-bit division related changes.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10964
Lustre-commit: 0300a6efd226 ("LU-10964 build: armv7 client build fixes")
Reviewed-on: https://review.whamcloud.com/32194
--- fs/lustre/ldlm/ldlm_request.c | 3 ++- fs/lustre/ptlrpc/import.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
fs/lustre/ldlm/ldlm_request.c +2 -1
@@ -1408,7 +1408,8 @@ static enum ldlm_policy_res ldlm_cancel_lrur_policy(struct ldlm_namespace *ns, slv =ldlm_pool_get_slv (pl); lvf =ldlm_pool_get_lvf (pl); - la =ktime_to_ns (ktime_sub (cur, lock->l_last_used)) /NSEC_PER_SEC ; + la =div_u64 (ktime_to_ns (ktime_sub (cur, lock->l_last_used)), +NSEC_PER_SEC ); lv = lvf * la * unused;/* Inform pool about current CLV to see it via debugfs. */
fs/lustre/ptlrpc/import.c +1 -1
@@ -289,7 +289,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp)*/ if (!OBD_FAIL_CHECK (OBD_FAIL_PTLRPC_LONG_REPL_UNLINK )) { timeout =ptlrpc_inflight_timeout (imp); - timeout += timeout /3 ; + timeout +=div_u64 (timeout,3 );if (timeout ==0 ) timeout = obd_timeout;
Signature · 1 line
1.8.3.1
PATCH 45/622 lustre: ldlm: fix l_last_activity usage
In reply to James SimmonsFrom: Alexander Boyko <[email protected]>
When race happen between ldlm_server_blocking_ast() and ldlm_request_cancel(), the at_measured() is called with wrong value equal to current time. And even worse, ldlm_bl_timeout() can return current_time*1.5.
Before a time functions was fixed by LU-9019(fdeeed2fb) for 64bit, this race leads to ETIMEDOUT at ptlrpc_import_delay_req() and client eviction during bl ast sending. The wrong type conversion take a place at pltrpc_send_limit_expired() at cfs_time_seconds().
We should not take cancels into accoount if the BLAST is not send, just because the last_activity is not properly initialised - it destroys the AT completely.
The patch devides l_last_activity to the client l_activity and server l_blast_sent for better understanding. The l_blast_sent is used for blocking ast only to measure time between BLAST and cancel request.
For example:
server cancels blocked lock after 1518731697s waiting_locks_callback()) ### lock callback timer expired after 0s:
evicting client
WC-bug-id: https://jira.whamcloud.com/browse/LU-10945
Lustre-commit: e09d273cb5f2 ("LU-10945 ldlm: fix l_last_activity usage")
Cray-bug-id: LUS-5736
Reviewed-on: https://review.whamcloud.com/32133
--- fs/lustre/include/lustre_dlm.h | 13 +++++++------ fs/lustre/ldlm/ldlm_lock.c | 1 + fs/lustre/ldlm/ldlm_request.c | 14 +++++++------- 3 files changed, 15 insertions(+), 13 deletions(-)
fs/lustre/include/lustre_dlm.h +7 -6
@@ -708,12 +708,6 @@ struct ldlm_lock {wait_queue_head_t l_waitq;/** -* Seconds. It will be updated if there is any activity related to -* the lock, e.g. enqueue the lock or send blocking AST. -*/ -time64_t l_last_activity; - -/** * Time, in nanoseconds, last used by e.g. being matched by lock match. */ ktime_t l_last_used;
@@ -735,6 +729,13 @@ struct ldlm_lock {/** Private storage for lock user. Opaque to LDLM. */ void *l_ast_data; + +/** +* Seconds. It will be updated if there is any activity related to +* the lock at client, e.g. enqueue the lock. +*/ +time64_t l_activity; +/* Separate ost_lvb used mostly by Data-on-MDT for now. * It is introduced to don't mix with layout lock data. */
fs/lustre/ldlm/ldlm_lock.c +1 -0
@@ -420,6 +420,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)lu_ref_init (&lock->l_reference);lu_ref_add (&lock->l_reference,"hash" , lock); lock->l_callback_timeout =0 ; + lock->l_activity =0 ;#if LUSTRE_TRACKS_LOCK_EXP_REFS INIT_LIST_HEAD (&lock->l_exp_refs_link);
fs/lustre/ldlm/ldlm_request.c +7 -7
@@ -114,9 +114,9 @@ static void ldlm_expired_completion_wait(struct ldlm_lock *lock, u32 conn_cnt)LDLM_ERROR (lock,"lock timed out (enqueued at %lld, %llds ago); not entering recovery in server code, just going back to sleep" , - (s64 )lock->l_last_activity, + (s64 )lock->l_activity, (s64)(ktime_get_real_seconds () - - lock->l_last_activity)); + lock->l_activity));if (ktime_get_seconds () > next_dump) { last_dump = next_dump; next_dump =ktime_get_seconds () +300 ;
@@ -133,8 +133,8 @@ static void ldlm_expired_completion_wait(struct ldlm_lock *lock, u32 conn_cnt)ptlrpc_fail_import (imp, conn_cnt);LDLM_ERROR (lock,"lock timed out (enqueued at %lld, %llds ago), entering recovery for %s@%s" , - (s64 )lock->l_last_activity, - (s64)(ktime_get_real_seconds () - lock->l_last_activity), + (s64 )lock->l_activity, + (s64)(ktime_get_real_seconds () - lock->l_activity),obd2cli_tgt (obd), imp->imp_connection->c_remote_uuid.uuid); }
@@ -182,7 +182,7 @@ static int ldlm_completion_tail(struct ldlm_lock *lock, void *data)LDLM_DEBUG (lock,"client-side enqueue: granted" ); }else {/* Take into AT only CP RPC, not immediately granted locks */ - delay =ktime_get_real_seconds () - lock->l_last_activity; + delay =ktime_get_real_seconds () - lock->l_activity;LDLM_DEBUG (lock,"client-side enqueue: granted after %lds" , delay);
@@ -245,7 +245,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, u64 flags, void *data) timeout =ldlm_cp_timeout (lock); - lock->l_last_activity =ktime_get_real_seconds (); + lock->l_activity =ktime_get_real_seconds ();if (imp) {spin_lock (&imp->imp_lock);
@@ -725,7 +725,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, lock->l_export =NULL ; lock->l_blocking_ast = einfo->ei_cb_bl; lock->l_flags |= (*flags & (LDLM_FL_NO_LRU |LDLM_FL_EXCL )); - lock->l_last_activity =ktime_get_real_seconds (); + lock->l_activity =ktime_get_real_seconds ();/* lock not sent to server yet */ if (!reqp || !*reqp) {
Signature · 1 line
1.8.3.1
PATCH 46/622 lustre: ptlrpc: Add WBC connect flag
In reply to James SimmonsFrom: Oleg Drokin <[email protected]>
It denotes ability of the node to understand additional types of intent requests, exclusive metadata locks issued to clients and server operations performed under such locks while still held by clients.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10938
Lustre-commit: f024aabf8bbf ("LU-10938 ptlrpc: Add WBC connect flag")
Reviewed-on: https://review.whamcloud.com/32241
--- fs/lustre/obdclass/lprocfs_status.c | 1 + fs/lustre/ptlrpc/wiretest.c | 2 ++ include/uapi/linux/lustre/lustre_idl.h | 5 +++++ 3 files changed, 8 insertions(+)
fs/lustre/obdclass/lprocfs_status.c +1 -0
@@ -117,6 +117,7 @@"unknown" ,/* 0x08 */ "unknown" ,/* 0x10 */ "flr" ,/* 0x20 */ +"wbc" ,/* 0x40 */ NULL };
fs/lustre/ptlrpc/wiretest.c +2 -0
@@ -1115,6 +1115,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_DIR_MIGRATE);LASSERTF (OBD_CONNECT2_FLR ==0x20ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_FLR ); +LASSERTF (OBD_CONNECT2_WBC_INTENTS ==0x40ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_WBC_INTENTS );LASSERTF (OBD_CKSUM_CRC32 ==0x00000001UL ,"found 0x%.8xUL\n" , (unsigned int )OBD_CKSUM_CRC32 ); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +5 -0
@@ -794,6 +794,11 @@ struct ptlrpc_body_v2 {#define OBD_CONNECT2_DIR_MIGRATE 0x4ULL/* migrate striped dir */ #define OBD_CONNECT2_FLR 0x20ULL/* FLR support */ +#define OBD_CONNECT2_WBC_INTENTS 0x40ULL/* create/unlink/... intents +* for wbc, also operations +* under client-held parent +* locks +*/ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same
Signature · 1 line
1.8.3.1
PATCH 47/622 lustre: llog: remove obsolete llog handlers
In reply to James SimmonsFrom: "John L. Hammond" <[email protected]>
Remove the obsolete llog RPC handling for cancel, close, and destroy. Remove llog handling from ldlm_callback_handler(). Remove the unused client side method llog_client_destroy().
WC-bug-id: https://jira.whamcloud.com/browse/LU-10855
Lustre-commit: 85011d372dfb ("LU-10855 llog: remove obsolete llog handlers")
Reviewed-on: https://review.whamcloud.com/32202
--- fs/lustre/include/lustre_req_layout.h | 3 --- fs/lustre/ptlrpc/layout.c | 26 -------------------------- include/uapi/linux/lustre/lustre_idl.h | 12 ++++++------ 3 files changed, 6 insertions(+), 35 deletions(-)
fs/lustre/include/lustre_req_layout.h +0 -3
@@ -212,13 +212,10 @@ void req_capsule_shrink(struct req_capsule *pill,extern struct req_format RQF_LDLM_GL_CALLBACK ;extern struct req_format RQF_LDLM_GL_CALLBACK_DESC ;/* LOG req_format */ -extern struct req_format RQF_LOG_CANCEL ;extern struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE ; -extern struct req_format RQF_LLOG_ORIGIN_HANDLE_DESTROY ;extern struct req_format RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK ;extern struct req_format RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK ;extern struct req_format RQF_LLOG_ORIGIN_HANDLE_READ_HEADER ; -extern struct req_format RQF_LLOG_ORIGIN_CONNECT ;extern struct req_format RQF_CONNECT ;
fs/lustre/ptlrpc/layout.c +0 -26
@@ -88,11 +88,6 @@ &RMF_MGS_CONFIG_RES }; -static const struct req_msg_field *log_cancel_client[] = { - &RMF_PTLRPC_BODY , - &RMF_LOGCOOKIES -}; -static const struct req_msg_field *mdt_body_only[] = { &RMF_PTLRPC_BODY , &RMF_MDT_BODY
@@ -547,11 +542,6 @@ &RMF_LLOG_LOG_HDR }; -static const struct req_msg_field *llogd_conn_body_only[] = { - &RMF_PTLRPC_BODY , - &RMF_LLOGD_CONN_BODY -}; -static const struct req_msg_field *llog_origin_handle_next_block_server[] = { &RMF_PTLRPC_BODY , &RMF_LLOGD_BODY ,
@@ -766,13 +756,10 @@ &RQF_LDLM_INTENT_CREATE , &RQF_LDLM_INTENT_UNLINK , &RQF_LDLM_INTENT_GETXATTR , - &RQF_LOG_CANCEL , &RQF_LLOG_ORIGIN_HANDLE_CREATE , - &RQF_LLOG_ORIGIN_HANDLE_DESTROY , &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK , &RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK , &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER , - &RQF_LLOG_ORIGIN_CONNECT , &RQF_CONNECT, };
@@ -1254,10 +1241,6 @@ struct req_format RQF_FLD_READ =DEFINE_REQ_FMT0 ("FLD_READ" , fld_read_client, fld_read_server);EXPORT_SYMBOL (RQF_FLD_READ ); -struct req_format RQF_LOG_CANCEL = -DEFINE_REQ_FMT0 ("OBD_LOG_CANCEL" , log_cancel_client, empty); -EXPORT_SYMBOL (RQF_LOG_CANCEL ); -struct req_format RQF_MDS_QUOTACTL =DEFINE_REQ_FMT0 ("MDS_QUOTACTL" , quotactl_only, quotactl_only);EXPORT_SYMBOL (RQF_MDS_QUOTACTL );
@@ -1511,11 +1494,6 @@ struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE = llog_origin_handle_create_client, llogd_body_only);EXPORT_SYMBOL (RQF_LLOG_ORIGIN_HANDLE_CREATE ); -struct req_format RQF_LLOG_ORIGIN_HANDLE_DESTROY = -DEFINE_REQ_FMT0 ("LLOG_ORIGIN_HANDLE_DESTROY" , - llogd_body_only, llogd_body_only); -EXPORT_SYMBOL (RQF_LLOG_ORIGIN_HANDLE_DESTROY ); -struct req_format RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK =DEFINE_REQ_FMT0 ("LLOG_ORIGIN_HANDLE_NEXT_BLOCK" , llogd_body_only, llog_origin_handle_next_block_server);
@@ -1531,10 +1509,6 @@ struct req_format RQF_LLOG_ORIGIN_HANDLE_READ_HEADER = llogd_body_only, llog_log_hdr_only);EXPORT_SYMBOL (RQF_LLOG_ORIGIN_HANDLE_READ_HEADER ); -struct req_format RQF_LLOG_ORIGIN_CONNECT = -DEFINE_REQ_FMT0 ("LLOG_ORIGIN_CONNECT" , llogd_conn_body_only, empty); -EXPORT_SYMBOL (RQF_LLOG_ORIGIN_CONNECT ); -struct req_format RQF_CONNECT =DEFINE_REQ_FMT0 ("CONNECT" , obd_connect_client, obd_connect_server);EXPORT_SYMBOL (RQF_CONNECT );
include/uapi/linux/lustre/lustre_idl.h +6 -6
@@ -2312,7 +2312,7 @@ struct cfg_marker {enum obd_cmd {OBD_PING =400 , -OBD_LOG_CANCEL , +OBD_LOG_CANCEL ,/* Obsolete since 1.5. */ OBD_QC_CALLBACK ,/* not used since 2.4 */ OBD_IDX_READ ,OBD_LAST_OPC
@@ -2624,12 +2624,12 @@ enum llogd_rpc_ops {LLOG_ORIGIN_HANDLE_CREATE =501 ,LLOG_ORIGIN_HANDLE_NEXT_BLOCK =502 ,LLOG_ORIGIN_HANDLE_READ_HEADER =503 , -LLOG_ORIGIN_HANDLE_WRITE_REC =504 , -LLOG_ORIGIN_HANDLE_CLOSE =505 , -LLOG_ORIGIN_CONNECT =506 , -LLOG_CATINFO =507 ,/* deprecated */ +LLOG_ORIGIN_HANDLE_WRITE_REC =504 ,/* Obsolete by 2.1. */ +LLOG_ORIGIN_HANDLE_CLOSE =505 ,/* Obsolete by 1.8. */ +LLOG_ORIGIN_CONNECT =506 ,/* Obsolete by 2.4. */ +LLOG_CATINFO =507 ,/* Obsolete by 2.3. */ LLOG_ORIGIN_HANDLE_PREV_BLOCK =508 , -LLOG_ORIGIN_HANDLE_DESTROY =509 ,/* for destroy llog object*/ +LLOG_ORIGIN_HANDLE_DESTROY =509 ,/* Obsolete. */ LLOG_LAST_OPC ,LLOG_FIRST_OPC =LLOG_ORIGIN_HANDLE_CREATE };
Signature · 1 line
1.8.3.1
PATCH 48/622 lustre: ldlm: fix for l_lru usage
In reply to James SimmonsFrom: Yang Sheng <[email protected]>
Fixes for lock convert code to prevent false assertion and busy locks in LRU:
- ensure no l_readers and l_writers when add lock to LRU after convert.
- don't verify l_lru without ns_lock.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11003
Lustre-commit: 2a77dd3bee76 ("LU-11003 ldlm: fix for l_lru usage")
Reviewed-on: https://review.whamcloud.com/32309
--- fs/lustre/ldlm/ldlm_inodebits.c | 1 - fs/lustre/ldlm/ldlm_request.c | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-)
fs/lustre/ldlm/ldlm_inodebits.c +0 -1
@@ -171,7 +171,6 @@ int ldlm_cli_dropbits(struct ldlm_lock *lock, u64 drop_bits)ldlm_set_cbpending (lock);ldlm_set_bl_ast (lock);unlock_res_and_lock (lock); -LASSERT (list_empty (&lock->l_lru)); goto exit; }
fs/lustre/ldlm/ldlm_request.c +11 -8
@@ -881,21 +881,25 @@ static int lock_convert_interpret(const struct lu_env *env, }else {ldlm_clear_converting (lock); -/* Concurrent BL AST has arrived, it may cause another convert -* or cancel so just exit here. +/* Concurrent BL AST may arrive and cause another convert +* or cancel so just do nothing here if bl_ast is set, +* finish with convert otherwise. */ if (!ldlm_is_bl_ast (lock)) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);/* Drop cancel_bits since there are no more converts -* and put lock into LRU if it is not there yet. +* and put lock into LRU if it is still not used and +* is not there yet. */ lock->l_policy_data.l_inodebits.cancel_bits =0 ; -spin_lock (&ns->ns_lock); -if (!list_empty (&lock->l_lru)) +if (!lock->l_readers && !lock->l_writers) { +spin_lock (&ns->ns_lock); +/* there is check for list_empty() inside */ ldlm_lock_remove_from_lru_nolock (lock); -ldlm_lock_add_to_lru_nolock (lock); -spin_unlock (&ns->ns_lock); +ldlm_lock_add_to_lru_nolock (lock); +spin_unlock (&ns->ns_lock); + } } }unlock_res_and_lock (lock);
@@ -903,7 +907,6 @@ static int lock_convert_interpret(const struct lu_env *env,if (rc) {lock_res_and_lock (lock);if (ldlm_is_converting (lock)) { -LASSERT (list_empty (&lock->l_lru));ldlm_clear_converting (lock);ldlm_set_cbpending (lock);ldlm_set_bl_ast (lock);
Signature · 1 line
1.8.3.1
PATCH 49/622 lustre: lov: Move lov_tgts_kobj init to lov_setup
In reply to James SimmonsFrom: Oleg Drokin <[email protected]>
and free it in lov_cleanup.
This looks like a more robust solution vs doint it in lov_putref esp. since we know refcount there crosses 0 repeatedly, confusing things.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11015
Lustre-commit: 313ac16698db ("LU-11015 lov: Move lov_tgts_kobj init to lov_setup")
Reviewed-on: https://review.whamcloud.com/32367
--- fs/lustre/lov/lov_obd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
fs/lustre/lov/lov_obd.c +8 -7
@@ -110,10 +110,6 @@ void lov_tgts_putref(struct obd_device *obd)/* Disconnect */ __lov_del_obd (obd, tgt); } - -if (lov->lov_tgts_kobj) -kobject_put (lov->lov_tgts_kobj); - }else {mutex_unlock (&lov->lov_lock); }
@@ -235,9 +231,6 @@ static int lov_connect(const struct lu_env *env,lov_tgts_getref (obd); - lov->lov_tgts_kobj =kobject_create_and_add ("target_obds" , - &obd->obd_kset.kobj); -for (i =0 ; i < lov->desc.ld_tgt_count; i++) { tgt = lov->lov_tgts[i];if (!tgt ||obd_uuid_empty (&tgt->ltd_uuid))
@@ -784,6 +777,9 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)if (rc) goto out_tunables; + lov->lov_tgts_kobj =kobject_create_and_add ("target_obds" , + &obd->obd_kset.kobj); +return 0 ; out_tunables:
@@ -799,6 +795,11 @@ static int lov_cleanup(struct obd_device *obd)struct lov_obd *lov = &obd->u.lov;struct pool_desc *pool, *tmp; +if (lov->lov_tgts_kobj) { +kobject_put (lov->lov_tgts_kobj); + lov->lov_tgts_kobj =NULL ; + } +list_for_each_entry_safe (pool, tmp, &lov->lov_pool_list, pool_list) {/* free pool structs */ CDEBUG (D_INFO ,"delete pool %p\n" , pool);
Signature · 1 line
1.8.3.1
PATCH 50/622 lustre: osc: add T10PI support for RPC checksum
In reply to James SimmonsFrom: Li Xi <[email protected]>
T10 Protection Information (T10 PI), previously known as Data Integrity Field (DIF), is a standard for end-to-end data integrity validation. T10 PI prevents silent data corruption, ensuring that incomplete and incorrect data cannot overwrite good data.
Lustre file system already supports RPC level checksum which validates the data in bulk RPCs when writing/reading data to/from objects on OSTs. RPC level checksum can detect data corruption that happens during RPC being transferred over the wire. However, it is not capable to prevent silent data corruption happening in other conditions, for example, memory corruption when data is cached in page cache. And by using the existing checksum mechanism, only disjoint protection coverage is provided. Thus, in order to provide end-to-end data protection, T10PI support for Lustre should be added.
In order to provide end-to-end data integrity validation, the T10 PI checksum of data in a sector need to be calculated on Lustre client side and validated later on the Lustre OSS side. The T10 protection information should be sent together with the data in the RPC. However, in order to avoid significant performance degradation, instead of sending all original guard tags for all sectors in a bulk RPC, the existing checksum feature of bulk RPC will be integrated together with the new T10PI feature.
When OST starts, necessary T10PI information will be extracted from storage, i.e. the T10PI DIF type and sector size. The DIF type could be one of TYPE1_IP, TYPE1_CRC, TYPE3_IP and TYPE3_CRC. And sector size could be either 512 or 4K bytes.
When an OSC is connecting to OST, OSC and OST will negotiate about the checksum types. New checksum types are added for T10PI support including OBD_CKSUM_T10IP512, OBD_CKSUM_T10IP4K, OBD_CKSUM_T10CRC512, and OBD_CKSUM_T10CRC4K. If the OST storage has T10PI suppoort, the only selectable T10PI checksum type would have the same type with the T10PI type of the hardware. The other existing checksum types (crc32, crc32c, adler32) are still valid options for the RPC checksum type.
When calculating RPC checksum of T10PI, the T10PI checksums of all sectors will be calculated first using the T10PI chekcsum type, i.e. 16-bit crc or IP checksum. And then RPC checksum will be calculated on all of the T10PI checksums. The RPC checksum type used in this step is always alder32. Considering that the checksum-of-checksums is only computed on a * 4KB chunk of GRD tags for a 1MB RPC for 512B sectors, or 16KB of GRD tags for 16MB of 4KB sectors, this is only 1/256 or 1/1024 of the total data being checksummed, so the checksum type used here should not affect overall system performance noticeably.
obdfilter.*.enforce_t10pi_cksum can be used to tune whether to enforce T10-PI checksum or not.
If the OST supports T10-PI feature and T10-PI chekcsum is enforced, clients will have no other choice for RPC checksum type other than using the T10PI chekcsum type. This is useful for enforcing end-to-end integrity in the whole system.
If the OST doesn't support T10-PI feature and T10-PI chekcsum is enforced, together with other checksums with reasonably good speeds (e.g. crc32, crc32c, adler, etc.), all the T10-PI checksum types (t10ip512, t10ip4K, t10crc512, t10crc4K) will be added to the available checksum types, regardless of the speeds of T10-PI chekcsums. This is useful for testing T10-PI checksums of RPC.
If the OST supports T10-PI feature and T10-PI chekcsum is NOT enforced, the corresponding T10-PI checksum type will be added to the checksum type list, regardless of the speed of the T10-PI chekcsum. This provide the clients to flexibility to choose whether to enable end-to-end integrity or not.
If the OST does NOT supports T10-PI feature and T10-PI chekcsum is NOT enforced, together with other checksums with reasonably good speeds, all the T10-PI checksum types with good speeds will be added into the checksum type list. Note that a T10-PI checksum type with a speed worse than half of Alder will NOT be added as a option. In this circumstance, T10-PI checksum types has the same behavior like other normal checksum types.
The clients that has no T10-PI RPC checksum support will not be affected by the above-mentioned logic. And that logic will only be enforced to the newly connected clients after changing obdfilter.*.enforce_t10pi_cksum on an OST.
Following are the speeds of different checksum types on a server with CPU of Intel(R) Xeon(R) E5-2650 @ 2.00GHz:
crc: 1575 MB/s
crc32c: 9763 MB/s
adler: 1255 MB/s
t10ip512: 6151 MB/s
t10ip4k: 7935 MB/s
t10crc512: 1119 MB/s
t10crc4k: 1531 MB/s
WC-bug-id: https://jira.whamcloud.com/browse/LU-10472
Lustre-commit: b1e7be00cb6e ("LU-10472 osc: add T10PI support for RPC checksum")
Reviewed-on: https://review.whamcloud.com/30980
--- fs/lustre/include/obd_cksum.h | 123 +++++++++------ fs/lustre/include/obd_class.h | 1 - fs/lustre/llite/llite_lib.c | 4 +- fs/lustre/obdclass/Makefile | 2 +- fs/lustre/obdclass/integrity.c | 273 +++++++++++++++++++++++++++++++++ fs/lustre/obdclass/obd_cksum.c | 151 ++++++++++++++++++ fs/lustre/osc/osc_request.c | 214 +++++++++++++++++++++++--- fs/lustre/ptlrpc/import.c | 8 +- fs/lustre/ptlrpc/wiretest.c | 17 +- include/uapi/linux/lustre/lustre_idl.h | 48 ++++-- net/lnet/libcfs/linux-crypto.c | 3 + 11 files changed, 753 insertions(+), 91 deletions(-) create mode 100644 fs/lustre/obdclass/integrity.c create mode 100644 fs/lustre/obdclass/obd_cksum.c
fs/lustre/include/obd_cksum.h +73 -50
@@ -35,6 +35,9 @@#include <linux/libcfs/libcfs_crypto.h> #include <uapi/linux/lustre/lustre_idl.h> +int obd_t10_cksum_speed (const char *obd_name, +enum cksum_type cksum_type); +static inline unsigned char cksum_obd2cfs (enum cksum_type cksum_type) {switch (cksum_type) {
@@ -51,59 +54,23 @@ static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type)return 0 ; } -/* The OBD_FL_CKSUM_* flags is packed into 5 bits of o_flags, since there can -* only be a single checksum type per RPC. -* -* The OBD_CHECKSUM_* type bits passed in ocd_cksum_types are a 32-bit bitmask -* since they need to represent the full range of checksum algorithms that -* both the client and server can understand. -* -* In case of an unsupported types/flags we fall back to ADLER -* because that is supported by all clients since 1.8 -* -* In case multiple algorithms are supported the best one is used. -*/ -static inline u32 cksum_type_pack (enum cksum_type cksum_type) -{ -unsigned int performance =0 , tmp; -u32 flag =OBD_FL_CKSUM_ADLER ; - -if (cksum_type &OBD_CKSUM_CRC32 ) { - tmp =cfs_crypto_hash_speed (cksum_obd2cfs (OBD_CKSUM_CRC32 )); -if (tmp > performance) { - performance = tmp; - flag =OBD_FL_CKSUM_CRC32 ; - } - } -if (cksum_type &OBD_CKSUM_CRC32C ) { - tmp =cfs_crypto_hash_speed (cksum_obd2cfs (OBD_CKSUM_CRC32C )); -if (tmp > performance) { - performance = tmp; - flag =OBD_FL_CKSUM_CRC32C ; - } - } -if (cksum_type &OBD_CKSUM_ADLER ) { - tmp =cfs_crypto_hash_speed (cksum_obd2cfs (OBD_CKSUM_ADLER )); -if (tmp > performance) { - performance = tmp; - flag =OBD_FL_CKSUM_ADLER ; - } - } -if (unlikely (cksum_type && !(cksum_type & (OBD_CKSUM_CRC32C | -OBD_CKSUM_CRC32 | -OBD_CKSUM_ADLER )))) -CWARN ("unknown cksum type %x\n" , cksum_type); - -return flag; -} +u32 obd_cksum_type_pack (const char *obd_name,enum cksum_type cksum_type); -static inline enum cksum_type cksum_type_unpack (u32 o_flags) +static inline enum cksum_type obd_cksum_type_unpack (u32 o_flags) {switch (o_flags &OBD_FL_CKSUM_ALL ) {case OBD_FL_CKSUM_CRC32C :return OBD_CKSUM_CRC32C ;case OBD_FL_CKSUM_CRC32 :return OBD_CKSUM_CRC32 ; +case OBD_FL_CKSUM_T10IP512 : +return OBD_CKSUM_T10IP512 ; +case OBD_FL_CKSUM_T10IP4K : +return OBD_CKSUM_T10IP4K ; +case OBD_FL_CKSUM_T10CRC512 : +return OBD_CKSUM_T10CRC512 ; +case OBD_FL_CKSUM_T10CRC4K : +return OBD_CKSUM_T10CRC4K ;default :break ; }
@@ -115,7 +82,7 @@ static inline enum cksum_type cksum_type_unpack(u32 o_flags)* 1.8 supported ADLER it is base and not depend on hw * Client uses all available local algos */ -static inline enum cksum_type cksum_types_supported_client (void ) +static inline enum cksum_type obd_cksum_types_supported_client (void ) {enum cksum_type ret =OBD_CKSUM_ADLER ;
@@ -128,6 +95,8 @@ static inline enum cksum_type cksum_types_supported_client(void) ret |=OBD_CKSUM_CRC32C ;if (cfs_crypto_hash_speed (cksum_obd2cfs (OBD_CKSUM_CRC32 )) >0 ) ret |=OBD_CKSUM_CRC32 ; +/* Client support all kinds of T10 checksum */ + ret |=OBD_CKSUM_T10_ALL ;return ret; }
@@ -140,14 +109,68 @@ static inline enum cksum_type cksum_types_supported_client(void)* Caution is advised, however, since what is fastest on a single client may * not be the fastest or most efficient algorithm on the server. */ -static inline enum cksum_type cksum_type_select (enum cksum_type cksum_types) +static inline enum cksum_type +obd_cksum_type_select (const char *obd_name,enum cksum_type cksum_types) { -return cksum_type_unpack (cksum_type_pack (cksum_types)); +u32 flag =obd_cksum_type_pack (obd_name, cksum_types); + +return obd_cksum_type_unpack (flag); }/* Checksum algorithm names. Must be defined in the same order as the * OBD_CKSUM_* flags. */ -#define DECLARE_CKSUM_NAME char *cksum_name[] = {"crc32", "adler", "crc32c"} +#define DECLARE_CKSUM_NAME const char *cksum_name[] = {"crc32", "adler", \ + "crc32c", "reserved", "t10ip512", "t10ip4K", "t10crc512", "t10crc4K"} + +typedef u16 (obd_dif_csum_fn ) (void *,unsigned int ); + +u16 obd_dif_crc_fn (void *data,unsigned int len); +u16 obd_dif_ip_fn (void *data,unsigned int len); +int obd_page_dif_generate_buffer (const char *obd_name,struct page *page, +u32 offset,u32 length, +u16 *guard_start,int guard_number, +int *used_number,int sector_size, +obd_dif_csum_fn *fn); +/* +* If checksum type is one T10 checksum types, init the csum_fn and sector +* size. Otherwise, init them to NULL/zero. +*/ +static inline void obd_t10_cksum2dif (enum cksum_type cksum_type, +obd_dif_csum_fn **fn,int *sector_size) +{ + *fn =NULL ; + *sector_size =0 ; + +switch (cksum_type) { +case OBD_CKSUM_T10IP512 : + *fn = obd_dif_ip_fn; + *sector_size =512 ; +break ; +case OBD_CKSUM_T10IP4K : + *fn = obd_dif_ip_fn; + *sector_size =4096 ; +break ; +case OBD_CKSUM_T10CRC512 : + *fn = obd_dif_crc_fn; + *sector_size =512 ; +break ; +case OBD_CKSUM_T10CRC4K : + *fn = obd_dif_crc_fn; + *sector_size =4096 ; +break ; +default : +break ; + } +} + +enum obd_t10_cksum_type { +OBD_T10_CKSUM_UNKNOWN =0 , +OBD_T10_CKSUM_IP512 , +OBD_T10_CKSUM_IP4K , +OBD_T10_CKSUM_CRC512 , +OBD_T10_CKSUM_CRC4K , +OBD_T10_CKSUM_MAX +};#endif /* __OBD_H */
fs/lustre/include/obd_class.h +0 -1
@@ -1687,7 +1687,6 @@ static inline void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out)extern char obd_jobid_name[];int class_procfs_init (void );int class_procfs_clean (void ); -/* prng.c */ #define ll_generate_random_uuid (uuid_out) \ get_random_bytes(uuid_out, sizeof(class_uuid_t))
fs/lustre/llite/llite_lib.c +2 -2
@@ -218,7 +218,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)OBD_CONNECT_LARGE_ACL ;#endif - data->ocd_cksum_types =cksum_types_supported_client (); + data->ocd_cksum_types =obd_cksum_types_supported_client ();if (OBD_FAIL_CHECK (OBD_FAIL_MDC_LIGHTWEIGHT ))/* flag mdc connection as lightweight, only used for test
@@ -432,7 +432,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)if (OBD_FAIL_CHECK (OBD_FAIL_OSC_CKSUM_ADLER_ONLY )) data->ocd_cksum_types =OBD_CKSUM_ADLER ;else - data->ocd_cksum_types =cksum_types_supported_client (); + data->ocd_cksum_types =obd_cksum_types_supported_client (); data->ocd_connect_flags |=OBD_CONNECT_LRU_RESIZE ;
fs/lustre/obdclass/Makefile +1 -1
@@ -8,4 +8,4 @@ obdclass-y := llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o \ lustre_handles.o lustre_peer.o statfs_pack.o linkea.o \ obdo.o obd_config.o obd_mount.o lu_object.o lu_ref.o \ cl_object.o cl_page.o cl_lock.o cl_io.o kernelcomm.o \ - jobid.o + jobid.o integrity.o obd_cksum.o
fs/lustre/obdclass/integrity.c new file +273 -0
273 lines not on this page · raw message
fs/lustre/obdclass/obd_cksum.c new file +151 -0
151 lines not on this page · raw message
fs/lustre/osc/osc_request.c +190 -24
300 lines not on this page · raw message
fs/lustre/ptlrpc/import.c +5 -3
@@ -786,11 +786,12 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp,* for algorithms we understand. The server masked off * the checksum types it doesn't support */ -if (!(ocd->ocd_cksum_types &cksum_types_supported_client ())) { +if (!(ocd->ocd_cksum_types & +obd_cksum_types_supported_client ())) {LCONSOLE_ERROR ("The negotiation of the checksum algorithm to use with server %s failed (%x/%x), disabling checksums\n" ,obd2cli_tgt (imp->imp_obd), ocd->ocd_cksum_types, -cksum_types_supported_client ()); +obd_cksum_types_supported_client ());return -EPROTO ; } cli->cl_supp_cksum_types = ocd->ocd_cksum_types;
@@ -801,7 +802,8 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp,*/ cli->cl_supp_cksum_types =OBD_CKSUM_ADLER ; } - cli->cl_cksum_type =cksum_type_select (cli->cl_supp_cksum_types); + cli->cl_cksum_type =obd_cksum_type_select (imp->imp_obd->obd_name, + cli->cl_supp_cksum_types);if (ocd->ocd_connect_flags &OBD_CONNECT_BRW_SIZE ) cli->cl_max_pages_per_rpc =
fs/lustre/ptlrpc/wiretest.c +16 -1
@@ -1123,6 +1123,18 @@ void lustre_assert_wire_constants(void) (unsigned int)OBD_CKSUM_ADLER);LASSERTF (OBD_CKSUM_CRC32C ==0x00000004UL ,"found 0x%.8xUL\n" , (unsigned int )OBD_CKSUM_CRC32C ); +LASSERTF (OBD_CKSUM_RESERVED ==0x00000008UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_RESERVED ); +LASSERTF (OBD_CKSUM_T10IP512 ==0x00000010UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_T10IP512 ); +LASSERTF (OBD_CKSUM_T10IP4K ==0x00000020UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_T10IP4K ); +LASSERTF (OBD_CKSUM_T10CRC512 ==0x00000040UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_T10CRC512 ); +LASSERTF (OBD_CKSUM_T10CRC4K ==0x00000080UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_T10CRC4K ); +LASSERTF (OBD_CKSUM_T10_TOP ==0x00000002UL ,"found 0x%.8xUL\n" , + (unsigned int )OBD_CKSUM_T10_TOP );/* Checks for struct ost_layout */ LASSERTF((int)sizeof(struct ost_layout) == 28, "found %lld\n",
@@ -1372,7 +1384,10 @@ void lustre_assert_wire_constants(void)BUILD_BUG_ON (OBD_FL_CKSUM_CRC32 !=0x00001000 );BUILD_BUG_ON (OBD_FL_CKSUM_ADLER !=0x00002000 );BUILD_BUG_ON (OBD_FL_CKSUM_CRC32C !=0x00004000 ); -BUILD_BUG_ON (OBD_FL_CKSUM_RSVD2 !=0x00008000 ); +BUILD_BUG_ON (OBD_FL_CKSUM_T10IP512 !=0x00005000 ); +BUILD_BUG_ON (OBD_FL_CKSUM_T10IP4K !=0x00006000 ); +BUILD_BUG_ON (OBD_FL_CKSUM_T10CRC512 !=0x00007000 ); +BUILD_BUG_ON (OBD_FL_CKSUM_T10CRC4K !=0x00008000 );BUILD_BUG_ON (OBD_FL_CKSUM_RSVD3 !=0x00010000 );BUILD_BUG_ON (OBD_FL_SHRINK_GRANT !=0x00020000 );BUILD_BUG_ON (OBD_FL_MMAP !=0x00040000 );
include/uapi/linux/lustre/lustre_idl.h +39 -9
72 lines not on this page · raw message
net/lnet/libcfs/linux-crypto.c +3 -0
@@ -318,6 +318,9 @@ int cfs_crypto_hash_final(struct ahash_request *req,* The speed is stored internally in the cfs_crypto_hash_speeds[] array, and * is available through the cfs_crypto_hash_speed() function. * +* This function needs to stay the same as obd_t10_performance_test() so that +* the speeds are comparable. +* * @hash_alg hash algorithm id (CFS_HASH_ALG_*) * @buf data buffer on which to compute the hash * @buf_len length of @buf on which to compute hash
Signature · 1 line
1.8.3.1
PATCH 51/622 lustre: ldlm: Reduce debug to console during eviction
In reply to James SimmonsFrom: Patrick Farrell <[email protected]>
During an eviction, Lustre calls ldlm_namespace_cleanup, and it will sometimes end up dumping all of the locks on a particular resource to the console log (ldlm_resource_complain), which is very wasteful and only rarely helpful.
Move the debug level for this to D_NETERROR since it is in the default debug mask.
Cray-bug-id: LUS-1418
WC-bug-id: https://jira.whamcloud.com/browse/LU-10648
Lustre-commit: f92fcb863cb9 ("LU-10648 ldlm: Reduce debug to console during eviction")
Reviewed-on: https://review.whamcloud.com/31237
--- fs/lustre/ldlm/ldlm_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/lustre/ldlm/ldlm_resource.c +2 -1
@@ -819,7 +819,8 @@ static int ldlm_resource_complain(struct cfs_hash *hs, struct cfs_hash_bd *bd,ldlm_ns_name (ldlm_res_to_ns (res)),PLDLMRES (res), res, atomic_read(&res->lr_refcount) - 1); -ldlm_resource_dump (D_ERROR , res); +/* Use D_NETERROR since it is in the default mask */ +ldlm_resource_dump (D_NETERROR , res);unlock_res (res);return 0 ; }
Signature · 1 line
1.8.3.1
PATCH 52/622 lustre: ptlrpc: idle connections can disconnect
In reply to James SimmonsFrom: Alex Zhuravlev <[email protected]>
- when new request is being allocated ptlrpc initiates connection if it's not connected yet
- if the import is idle (no locks, no active RPCs, no non-PING reply for last osc_idle_timeout seconds), then pinger tries to disconnect asynchronously
- currently only client-to-OST connections can be idle
- lctl set_param osc.*.idle_timeout=N controls new feature:
N=0 - disable
N>0 - seconds to idle before disconnect
- lctl set_param osc.*.idle_connect=N to reconnect if idle (N is positive number)
- OSC module parameter osc_idle_timeout controls default idle timeout and set to 20 seconds by default
WC-bug-id: https://jira.whamcloud.com/browse/LU-7236
Lustre-commit: 5a6ceb664f07 ("LU-7236 ptlrpc: idle connections can disconnect")
Reviewed-on: https://review.whamcloud.com/16682
--- fs/lustre/include/lustre_import.h | 17 +++-- fs/lustre/include/lustre_net.h | 1 + fs/lustre/lov/lov_ea.c | 3 +- fs/lustre/lov/lov_obd.c | 8 ++- fs/lustre/lov/lov_request.c | 25 ++++++-- fs/lustre/osc/lproc_osc.c | 66 +++++++++++++++++++ fs/lustre/osc/osc_request.c | 3 + fs/lustre/ptlrpc/client.c | 32 +++++++++- fs/lustre/ptlrpc/events.c | 3 +- fs/lustre/ptlrpc/import.c | 130 ++++++++++++++++++++++++++++++-------- fs/lustre/ptlrpc/pinger.c | 30 +++++++++ 11 files changed, 275 insertions(+), 43 deletions(-)
fs/lustre/include/lustre_import.h +11 -6
@@ -96,6 +96,8 @@ enum lustre_imp_state {LUSTRE_IMP_RECOVER =8 ,LUSTRE_IMP_FULL =9 ,LUSTRE_IMP_EVICTED =10 , +LUSTRE_IMP_IDLE =11 , + LUSTRE_IMP_LAST };/** Returns test string representation of numeric import state @state */
@@ -104,10 +106,10 @@ static inline char *ptlrpc_import_state_name(enum lustre_imp_state state)static char *import_state_names[] = {"<UNKNOWN>" ,"CLOSED" ,"NEW" ,"DISCONN" ,"CONNECTING" ,"REPLAY" ,"REPLAY_LOCKS" ,"REPLAY_WAIT" , -"RECOVER" ,"FULL" ,"EVICTED" , +"RECOVER" ,"FULL" ,"EVICTED" ,"IDLE" , }; -LASSERT (state <=LUSTRE_IMP_EVICTED ); +LASSERT (state <LUSTRE_IMP_LAST );return import_state_names[state]; }
@@ -226,12 +228,14 @@ struct obd_import {int imp_state_hist_idx;/** Current import generation. Incremented on every reconnect */ int imp_generation; +/* Idle connection initiated@this generation */ +int imp_initiated_at;/** Incremented every time we send reconnection request */ u32 imp_conn_cnt; -/** -* \see ptlrpc_free_committed remembers imp_generation value here -* after a check to save on unnecessary replay list iterations -*/ +/* +* \see ptlrpc_free_committed remembers imp_generation value here +* after a check to save on unnecessary replay list iterations +*/ int imp_last_generation_checked;/** Last transno we replayed */ u64 imp_last_replay_transno;
@@ -299,6 +303,7 @@ struct obd_import { imp_connected:1 ;u32 imp_connect_op; +u32 imp_idle_timeout;struct obd_connect_data imp_connect_data;u64 imp_connect_flags_orig;u64 imp_connect_flags2_orig;
fs/lustre/include/lustre_net.h +1 -0
@@ -1988,6 +1988,7 @@ struct ptlrpc_service *ptlrpc_register_service(struct ptlrpc_service_conf *conf,int ptlrpc_connect_import (struct obd_import *imp);int ptlrpc_init_import (struct obd_import *imp);int ptlrpc_disconnect_import (struct obd_import *imp,int noclose); +int ptlrpc_disconnect_and_idle_import (struct obd_import *imp);int ptlrpc_import_recovery_state_machine (struct obd_import *imp);/* ptlrpc/pack_generic.c */
fs/lustre/lov/lov_ea.c +2 -1
@@ -70,7 +70,8 @@ static loff_t lov_tgt_maxbytes(struct lov_tgt_desc *tgt)return maxbytes;spin_lock (&imp->imp_lock); -if (imp->imp_state ==LUSTRE_IMP_FULL && +if ((imp->imp_state ==LUSTRE_IMP_FULL || + imp->imp_state ==LUSTRE_IMP_IDLE ) && (imp->imp_connect_data.ocd_connect_flags &OBD_CONNECT_MAXBYTES ) && imp->imp_connect_data.ocd_maxbytes >0 ) maxbytes = imp->imp_connect_data.ocd_maxbytes;
fs/lustre/lov/lov_obd.c +6 -2
@@ -977,17 +977,21 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,struct obd_ioctl_data *data = karg;struct obd_device *osc_obd;struct obd_statfs stat_buf = {0 }; +struct obd_import *imp;u32 index;u32 flags; -memcpy (&index, data->ioc_inlbuf2,sizeof (u32)); +memcpy (&index, data->ioc_inlbuf2,sizeof (index));if (index >= count)return -ENODEV ;if (!lov->lov_tgts[index])/* Try again with the next index */ return -EAGAIN ; -if (!lov->lov_tgts[index]->ltd_active) + + imp = lov->lov_tgts[index]->ltd_exp->exp_obd->u.cli.cl_import; +if (!lov->lov_tgts[index]->ltd_active && + imp->imp_state !=LUSTRE_IMP_IDLE )return -ENODATA ; osc_obd =class_exp2obd (lov->lov_tgts[index]->ltd_exp);
fs/lustre/lov/lov_request.c +19 -6
@@ -99,6 +99,7 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx) {int cnt =0 ;struct lov_tgt_desc *tgt; +struct obd_import *imp =NULL ;int rc =0 ;mutex_lock (&lov->lov_lock);
@@ -115,7 +116,13 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx) goto out; } -if (tgt->ltd_exp &&class_exp2cliimp (tgt->ltd_exp)->imp_connect_tried) { +if (tgt->ltd_exp) + imp =class_exp2cliimp (tgt->ltd_exp); +if (imp && imp->imp_connect_tried) { + rc =0 ; + goto out; + } +if (imp && imp->imp_state ==LUSTRE_IMP_IDLE ) { rc =0 ; goto out; }
@@ -302,11 +309,10 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,/* We only get block data from the OBD */ for (i =0 ; i < lov->desc.ld_tgt_count; i++) { +struct lov_tgt_desc *ltd = lov->lov_tgts[i];struct lov_request *req; -if (!lov->lov_tgts[i] || - (oinfo->oi_flags &OBD_STATFS_NODELAY && - !lov->lov_tgts[i]->ltd_active)) { +if (!ltd) {CDEBUG (D_HA ,"lov idx %d inactive\n" , i);continue ; }
@@ -314,13 +320,20 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,/* skip targets that have been explicitly disabled by the * administrator */ -if (!lov->lov_tgts[i]->ltd_exp) { +if (!ltd->ltd_exp) {CDEBUG (D_HA ,"lov idx %d administratively disabled\n" , i);continue ; } -if (!lov->lov_tgts[i]->ltd_active) +if (oinfo->oi_flags &OBD_STATFS_NODELAY && +class_exp2cliimp (ltd->ltd_exp)->imp_state != +LUSTRE_IMP_IDLE && !ltd->ltd_active) { +CDEBUG (D_HA ,"lov idx %d inactive\n" , i); +continue ; + } + +if (!ltd->ltd_active)lov_check_and_wait_active (lov, i); req =kzalloc (sizeof (*req),GFP_NOFS );
fs/lustre/osc/lproc_osc.c +66 -0
78 lines not on this page · raw message
fs/lustre/osc/osc_request.c +3 -0
@@ -61,6 +61,8 @@/* max memory used for request pool, unit is MB */ static unsigned int osc_reqpool_mem_max =5 ;module_param (osc_reqpool_mem_max, uint,0444 ); +static int osc_idle_timeout =20 ; +module_param (osc_idle_timeout, uint,0644 );struct osc_async_args {struct obd_info *aa_oi;
@@ -3214,6 +3216,7 @@ int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)spin_lock (&osc_shrink_lock);list_add_tail (&cli->cl_shrink_list, &osc_shrink_list);spin_unlock (&osc_shrink_lock); + cli->cl_import->imp_idle_timeout = osc_idle_timeout;return rc;
fs/lustre/ptlrpc/client.c +30 -2
@@ -885,6 +885,28 @@ struct ptlrpc_request *__ptlrpc_request_alloc(struct obd_import *imp, const struct req_format *format) {struct ptlrpc_request *request; +int connect =0 ; + +if (unlikely (imp->imp_state ==LUSTRE_IMP_IDLE )) { +int rc; + +CDEBUG (D_INFO ,"%s: connect at new req\n" , + imp->imp_obd->obd_name); +spin_lock (&imp->imp_lock); +if (imp->imp_state ==LUSTRE_IMP_IDLE ) { + imp->imp_generation++; + imp->imp_initiated_at = imp->imp_generation; + imp->imp_state =LUSTRE_IMP_NEW ; + connect =1 ; + } +spin_unlock (&imp->imp_lock); +if (connect) { + rc =ptlrpc_connect_import (imp); +if (rc <0 ) +return NULL ; +ptlrpc_pinger_add_import (imp); + } + } request =__ptlrpc_request_alloc (imp, pool);if (!request)
@@ -1075,6 +1097,7 @@ void ptlrpc_set_add_req(struct ptlrpc_request_set *set,return ; } +LASSERT (req->rq_import->imp_state !=LUSTRE_IMP_IDLE );LASSERT (list_empty (&req->rq_set_chain));/* The set takes over the caller's request reference */
@@ -1183,7 +1206,9 @@ static int ptlrpc_import_delay_req(struct obd_import *imp,if (atomic_read (&imp->imp_inval_count) !=0 ) {DEBUG_REQ (D_ERROR , req,"invalidate in flight" ); *status = -EIO ; - }else if (req->rq_no_delay) { + }else if (req->rq_no_delay && + imp->imp_generation != imp->imp_initiated_at) { +/* ignore nodelay for requests initiating connections */ *status = -EWOULDBLOCK ; } else if (req->rq_allow_replay && (imp->imp_state == LUSTRE_IMP_REPLAY ||
@@ -1842,8 +1867,11 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)spin_unlock (&imp->imp_lock); goto interpret; } +/* ignore on just initiated connections */ if (ptlrpc_no_resend (req) && - !req->rq_wait_ctx) { + !req->rq_wait_ctx && + imp->imp_generation != + imp->imp_initiated_at) { req->rq_status = -ENOTCONN ;ptlrpc_rqphase_move (req,RQ_PHASE_INTERPRET );
fs/lustre/ptlrpc/events.c +2 -1
@@ -164,7 +164,8 @@ void reply_in_callback(struct lnet_event *ev) ev->mlength, ev->offset, req->rq_replen); } - req->rq_import->imp_last_reply_time =ktime_get_real_seconds (); +if (lustre_msg_get_opc (req->rq_reqmsg) !=OBD_PING ) + req->rq_import->imp_last_reply_time =ktime_get_real_seconds (); out_wake:/* NB don't unlock till after wakeup; req can disappear under us
fs/lustre/ptlrpc/import.c +105 -25
167 lines not on this page · raw message
fs/lustre/ptlrpc/pinger.c +30 -0
@@ -79,10 +79,40 @@ int ptlrpc_obd_ping(struct obd_device *obd) }EXPORT_SYMBOL (ptlrpc_obd_ping); +static bool ptlrpc_check_import_is_idle (struct obd_import *imp) +{ +struct ldlm_namespace *ns = imp->imp_obd->obd_namespace; +time64_t now; + +if (!imp->imp_idle_timeout) +return false; +/* 4 comes from: +* - client_obd_setup() - hashed import +* - ptlrpcd_alloc_work() +* - ptlrpcd_alloc_work() +* - ptlrpc_pinger_add_import +*/ +if (atomic_read (&imp->imp_refcount) >4 ) +return false; + +/* any lock increases ns_bref being a resource holder */ +if (ns &&atomic_read (&ns->ns_bref) >0 ) +return false; + + now =ktime_get_real_seconds (); +if (now - imp->imp_last_reply_time < imp->imp_idle_timeout) +return false; + +return true; +} +static int ptlrpc_ping (struct obd_import *imp) {struct ptlrpc_request *req; +if (ptlrpc_check_import_is_idle (imp)) +return ptlrpc_disconnect_and_idle_import (imp); + req =ptlrpc_prep_ping (imp);if (!req) { CERROR("OOM trying to ping %s->%s\n",
Signature · 1 line
1.8.3.1
PATCH 53/622 lustre: osc: truncate does not update blocks count on client
In reply to James SimmonsFrom: Arshad Hussain <[email protected]>
'truncate' call correctly updates the server side with correct size and blocks count. However, on the client side all the metadata are correctly updated except the blocks count, which still reflects the old count prior to truncate call. This patch fixes this issue on the client by modifying osc_io_setattr_end() to update attr with the updated block count.
New test case under sanity is added to verify the that the blocks counts are correctly updated after truncate call
WC-bug-id: https://jira.whamcloud.com/browse/LU-10370
Lustre-commit: 6115eb7fd55a ("LU-10370 ofd: truncate does not update blocks count on client")
Reviewed-on: https://review.whamcloud.com/31073
--- fs/lustre/osc/osc_io.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fs/lustre/osc/osc_io.c +11 -0
@@ -588,6 +588,9 @@ void osc_io_setattr_end(const struct lu_env *env,struct osc_io *oio =cl2osc_io (env, slice);struct cl_object *obj = slice->cis_obj;struct osc_async_cbargs *cbargs = &oio->oi_cbarg; +struct cl_attr *attr = &osc_env_info (env)->oti_attr; +struct obdo *oa = &oio->oi_oa; +unsigned int cl_valid =0 ;int result =0 ;if (cbargs->opc_rpc_sent) {
@@ -609,6 +612,14 @@ void osc_io_setattr_end(const struct lu_env *env,if (cl_io_is_trunc (io)) {u64 size = io->u.ci_setattr.sa_attr.lvb_size; +cl_object_attr_lock (obj); +if (oa->o_valid &OBD_MD_FLBLOCKS ) { + attr->cat_blocks = oa->o_blocks; + cl_valid |=CAT_BLOCKS ; + } + +cl_object_attr_update (env, obj, attr, cl_valid); +cl_object_attr_unlock (obj);osc_trunc_check (env, io, oio, size);osc_cache_truncate_end (env, oio->oi_trunc); oio->oi_trunc =NULL ;
Signature · 1 line
1.8.3.1
PATCH 54/622 lustre: ptlrpc: add LOCK_CONVERT connection flag
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
Add LOCK_CONVERT connection flag to don't use lock convert feature with old servers.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10175
Lustre-commit: 44a2092f08ca ("LU-10175 ptlrpc: add LOCK_CONVERT connection flag")
Reviewed-on: https://review.whamcloud.com/32593
--- fs/lustre/obdclass/lprocfs_status.c | 1 + fs/lustre/ptlrpc/wiretest.c | 2 ++ include/uapi/linux/lustre/lustre_idl.h | 1 + 3 files changed, 4 insertions(+)
fs/lustre/obdclass/lprocfs_status.c +1 -0
@@ -118,6 +118,7 @@"unknown" ,/* 0x10 */ "flr" ,/* 0x20 */ "wbc" ,/* 0x40 */ +"lock_convert" ,/* 0x80 */ NULL };
fs/lustre/ptlrpc/wiretest.c +2 -0
@@ -1117,6 +1117,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_FLR);LASSERTF (OBD_CONNECT2_WBC_INTENTS ==0x40ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_WBC_INTENTS ); +LASSERTF (OBD_CONNECT2_LOCK_CONVERT ==0x80ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_LOCK_CONVERT );LASSERTF (OBD_CKSUM_CRC32 ==0x00000001UL ,"found 0x%.8xUL\n" , (unsigned int )OBD_CKSUM_CRC32 ); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +1 -0
@@ -799,6 +799,7 @@ struct ptlrpc_body_v2 {* under client-held parent * locks */ +#define OBD_CONNECT2_LOCK_CONVERT 0x80ULL/* IBITS lock convert support */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same
Signature · 1 line
1.8.3.1
PATCH 55/622 lustre: ldlm: handle lock converts in cancel handler
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
- Use cancel portals and high-priority handling for lock converts. Update ldlm_cancel_handler to understand LDLM_CONVERT RPC for that.
- Use ns_dirty_age_limit for lock convert - don't convert too old locks.
- Check for empty converts and skip such
WC-bug-id: https://jira.whamcloud.com/browse/LU-10175
Lustre-commit: 541902a3f934 ("LU-10175 ldlm: handle lock converts in cancel handler")
Reviewed-on: https://review.whamcloud.com/32314
--- fs/lustre/include/lustre_export.h | 6 ++++++ fs/lustre/ldlm/ldlm_inodebits.c | 19 ++++++++++++++----- fs/lustre/ldlm/ldlm_request.c | 39 +++++++++++++++++++++++++++++++-------- fs/lustre/llite/llite_lib.c | 2 +- fs/lustre/llite/namei.c | 7 ++++++- 5 files changed, 58 insertions(+), 15 deletions(-)
fs/lustre/include/lustre_export.h +6 -0
@@ -269,9 +269,15 @@ static inline int exp_connect_flr(struct obd_export *exp)return !!(exp_connect_flags2 (exp) &OBD_CONNECT2_FLR ); } +static inline int exp_connect_lock_convert (struct obd_export *exp) +{ +return !!(exp_connect_flags2 (exp) &OBD_CONNECT2_LOCK_CONVERT ); +} +struct obd_export *class_conn2export (struct lustre_handle *conn);#define KKUC_CT_DATA_MAGIC 0x092013cea +struct kkuc_ct_data {u32 kcd_magic;u32 kcd_archive;
fs/lustre/ldlm/ldlm_inodebits.c +14 -5
@@ -81,7 +81,7 @@ int ldlm_inodebits_drop(struct ldlm_lock *lock, u64 to_drop)/* Just return if there are no conflicting bits */ if ((lock->l_policy_data.l_inodebits.bits & to_drop) ==0 ) { -LDLM_WARN (lock,"try to drop unset bits %#llx/%#llx\n" , +LDLM_WARN (lock,"try to drop unset bits %#llx/%#llx" , lock->l_policy_data.l_inodebits.bits, to_drop);/* nothing to do */ return 0 ;
@@ -111,7 +111,7 @@ int ldlm_cli_dropbits(struct ldlm_lock *lock, u64 drop_bits)ldlm_lock2handle (lock, &lockh);lock_res_and_lock (lock); -/* check if all bits are cancelled */ +/* check if all bits are blocked */ if (!(lock->l_policy_data.l_inodebits.bits & ~drop_bits)) {unlock_res_and_lock (lock);/* return error to continue with cancel */
@@ -119,6 +119,13 @@ int ldlm_cli_dropbits(struct ldlm_lock *lock, u64 drop_bits) goto exit; } +/* check if no common bits, consider this as successful convert */ +if (!(lock->l_policy_data.l_inodebits.bits & drop_bits)) { +unlock_res_and_lock (lock); + rc =0 ; + goto exit; + } +/* check if there is race with cancel */ if (ldlm_is_canceling (lock) ||ldlm_is_cancel (lock)) {unlock_res_and_lock (lock);
@@ -167,9 +174,11 @@ int ldlm_cli_dropbits(struct ldlm_lock *lock, u64 drop_bits) rc =ldlm_cli_convert (lock, &flags);if (rc) {lock_res_and_lock (lock); -ldlm_clear_converting (lock); -ldlm_set_cbpending (lock); -ldlm_set_bl_ast (lock); +if (ldlm_is_converting (lock)) { +ldlm_clear_converting (lock); +ldlm_set_cbpending (lock); +ldlm_set_bl_ast (lock); + }unlock_res_and_lock (lock); goto exit; }
fs/lustre/ldlm/ldlm_request.c +31 -8
@@ -854,7 +854,7 @@ static int lock_convert_interpret(const struct lu_env *env, aa->lock_handle.cookie, reply->lock_handle.cookie, req->rq_export->exp_client_uuid.uuid, libcfs_id2str(req->rq_peer)); - rc = -ESTALE ; + rc =ELDLM_NO_LOCK_DATA ; goto out; }
@@ -905,15 +905,30 @@ static int lock_convert_interpret(const struct lu_env *env,unlock_res_and_lock (lock); out:if (rc) { +int flag; +lock_res_and_lock (lock);if (ldlm_is_converting (lock)) {ldlm_clear_converting (lock);ldlm_set_cbpending (lock);ldlm_set_bl_ast (lock); + lock->l_policy_data.l_inodebits.cancel_bits =0 ; }unlock_res_and_lock (lock); - } +/* fallback to normal lock cancel. If rc means there is no +* valid lock on server, do only local cancel +*/ +if (rc ==ELDLM_NO_LOCK_DATA ) + flag =LCF_LOCAL ; +else + flag =LCF_ASYNC ; + + rc =ldlm_cli_cancel (&aa->lock_handle, flag); +if (rc <0 ) +LDLM_DEBUG (lock,"failed to cancel lock: rc = %d\n" , + rc); + }LDLM_LOCK_PUT (lock);return rc; }
@@ -942,6 +957,15 @@ int ldlm_cli_convert(struct ldlm_lock *lock, u32 *flags)return -EINVAL ; } +/* this is better to check earlier and it is done so already, +* but this check is kept too as final one to issue an error +* if any new code will miss such check. +*/ +if (!exp_connect_lock_convert (exp)) { +LDLM_ERROR (lock,"server doesn't support lock convert\n" ); +return -EPROTO ; + } +if (lock->l_resource->lr_type !=LDLM_IBITS ) {LDLM_ERROR (lock,"convert works with IBITS locks only." );return -EINVAL ;
@@ -970,13 +994,12 @@ int ldlm_cli_convert(struct ldlm_lock *lock, u32 *flags)ptlrpc_request_set_replen (req); -/* That could be useful to use cancel portals for convert as well -* as high-priority handling. This will require changes in -* ldlm_cancel_handler to understand convert RPC as well. -* -* req->rq_request_portal = LDLM_CANCEL_REQUEST_PORTAL; -* req->rq_reply_portal = LDLM_CANCEL_REPLY_PORTAL; +/* +* Use cancel portals for convert as well as high-priority handling. */ + req->rq_request_portal =LDLM_CANCEL_REQUEST_PORTAL ; + req->rq_reply_portal =LDLM_CANCEL_REPLY_PORTAL ; +ptlrpc_at_set_req_timeout (req);if (exp->exp_obd->obd_svc_stats)
fs/lustre/llite/llite_lib.c +1 -1
@@ -209,7 +209,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)OBD_CONNECT_GRANT_PARAM |OBD_CONNECT_SHORTIO |OBD_CONNECT_FLAGS2 ; - data->ocd_connect_flags2 =OBD_CONNECT2_FLR ; + data->ocd_connect_flags2 =OBD_CONNECT2_FLR |OBD_CONNECT2_LOCK_CONVERT ;if (sbi->ll_flags &LL_SBI_LRU_RESIZE ) data->ocd_connect_flags |=OBD_CONNECT_LRU_RESIZE ;
fs/lustre/llite/namei.c +6 -1
@@ -371,11 +371,16 @@ void ll_lock_cancel_bits(struct ldlm_lock *lock, u64 to_cancel)*/ int ll_md_need_convert (struct ldlm_lock *lock) { +struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);struct inode *inode;u64 wanted = lock->l_policy_data.l_inodebits.cancel_bits;u64 bits = lock->l_policy_data.l_inodebits.bits & ~wanted;enum ldlm_mode mode =LCK_MINMODE ; +if (!lock->l_conn_export || + !exp_connect_lock_convert (lock->l_conn_export)) +return 0 ; +if (!wanted || !bits ||ldlm_is_cancel (lock))return 0 ;
@@ -410,7 +415,7 @@ int ll_md_need_convert(struct ldlm_lock *lock)lock_res_and_lock (lock);if (ktime_after (ktime_get (),ktime_add (lock->l_last_used, -ktime_set (10 ,0 )))) { +ktime_set (ns->ns_dirty_age_limit,0 )))) {unlock_res_and_lock (lock);return 0 ; }
Signature · 1 line
1.8.3.1
PATCH 56/622 lustre: ptlrpc: Serialize procfs access to scp_hist_reqs using mutex
In reply to James SimmonsFrom: Andriy Skulysh <[email protected]>
scp_hist_reqs list can be quite long thus a lot of userland processes can waste CPU power in spinlock cycles.
Cray-bug-id: LUS-5833
WC-bug-id: https://jira.whamcloud.com/browse/LU-11004
Lustre-commit: 413a738a37d7 ("LU-11004 ptlrpc: Serialize procfs access to scp_hist_reqs using mutex")
Reviewed-on: https://review.whamcloud.com/32307
--- fs/lustre/include/lustre_net.h | 2 ++ fs/lustre/ptlrpc/lproc_ptlrpc.c | 7 +++++++ fs/lustre/ptlrpc/service.c | 1 + 3 files changed, 10 insertions(+)
fs/lustre/include/lustre_net.h +2 -0
@@ -1543,6 +1543,8 @@ struct ptlrpc_service_part {* threads starting & stopping are also protected by this lock. */ spinlock_t scp_lock __cfs_cacheline_aligned; +/* userland serialization */ +struct mutex scp_mutex;/** total # req buffer descs allocated */ int scp_nrqbds_total;/** # posted request buffers for receiving */
fs/lustre/ptlrpc/lproc_ptlrpc.c +7 -0
@@ -869,10 +869,12 @@ struct ptlrpc_srh_iterator {if (i > cpt)/* make up the lowest position for this CPT */ *pos =PTLRPC_REQ_CPT2POS (svc, i); +mutex_lock (&svcpt->scp_mutex);spin_lock (&svcpt->scp_lock); rc =ptlrpc_lprocfs_svc_req_history_seek (svcpt, srhi,PTLRPC_REQ_POS2SEQ (svc, *pos));spin_unlock (&svcpt->scp_lock); +mutex_unlock (&svcpt->scp_mutex);if (rc ==0 ) { *pos =PTLRPC_REQ_SEQ2POS (svc, srhi->srhi_seq); srhi->srhi_idx = i;
@@ -914,9 +916,11 @@ struct ptlrpc_srh_iterator { seq = srhi->srhi_seq + (1 << svc->srv_cpt_bits); } +mutex_lock (&svcpt->scp_mutex);spin_lock (&svcpt->scp_lock); rc =ptlrpc_lprocfs_svc_req_history_seek (svcpt, srhi, seq);spin_unlock (&svcpt->scp_lock); +mutex_unlock (&svcpt->scp_mutex);if (rc ==0 ) { *pos =PTLRPC_REQ_SEQ2POS (svc, srhi->srhi_seq); srhi->srhi_idx = i;
@@ -940,6 +944,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) svcpt = svc->srv_parts[srhi->srhi_idx]; +mutex_lock (&svcpt->scp_mutex);spin_lock (&svcpt->scp_lock); rc =ptlrpc_lprocfs_svc_req_history_seek (svcpt, srhi, srhi->srhi_seq);
@@ -980,6 +985,8 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) }spin_unlock (&svcpt->scp_lock); +mutex_unlock (&svcpt->scp_mutex); +return rc; }
fs/lustre/ptlrpc/service.c +1 -0
@@ -471,6 +471,7 @@ static void ptlrpc_at_timer(struct timer_list *t)/* rqbd and incoming request queue */ spin_lock_init (&svcpt->scp_lock); +mutex_init (&svcpt->scp_mutex);INIT_LIST_HEAD (&svcpt->scp_rqbd_idle);INIT_LIST_HEAD (&svcpt->scp_rqbd_posted);INIT_LIST_HEAD (&svcpt->scp_req_incoming);
Signature · 1 line
1.8.3.1
PATCH 57/622 lustre: ldlm: don't add canceling lock back to LRU
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
When lock is converted check it is not canceling before adding it back to LRU.
Lustre-commit: ad52f394bd82 ("LU-11003 ldlm: don't add canceling lock back to LRU")
Reviewed-on: https://review.whamcloud.com/32692
--- fs/lustre/ldlm/ldlm_request.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/lustre/ldlm/ldlm_request.c +2 -1
@@ -893,7 +893,8 @@ static int lock_convert_interpret(const struct lu_env *env,* is not there yet. */ lock->l_policy_data.l_inodebits.cancel_bits =0 ; -if (!lock->l_readers && !lock->l_writers) { +if (!lock->l_readers && !lock->l_writers && + !ldlm_is_canceling (lock)) {spin_lock (&ns->ns_lock);/* there is check for list_empty() inside */ ldlm_lock_remove_from_lru_nolock (lock);
Signature · 1 line
1.8.3.1
PATCH 58/622 lustre: quota: add default quota setting support
In reply to James SimmonsFrom: Hongchao Zhang <[email protected]>
Similar function which is motivated by GPFS which is friendly feature for cluster administrators to manage quota.
Lazy Quota default setting support, here is basic idea:
Default quota setting is global quota setting for user, group, project quotas, if default quota is set for one quota type, newer created users/groups/projects will inherit this setting automatically, since Lustre itself don't have ideas when new users created, they could only know when this users trying to acquire space from Lustre.
So we try to implement lazy quota setting inherit, Slave firstly check if there exists default quota setting, if exists, it will force slave to acquire quota from master, and master will detect whether default quota is set, then it will set this quota and also return proper grant space to slave.
To implement this and reuse existed quota APIs, we try to manage the default quota in the quota record of 0 id, and enforce the quota check when reading the quota recored from disk.
In the current Lustre implementation, the grace time is either the time or the timestamp to be used after some quota ID exceeds the soft limt, then 48bits should be enough for it, its high 16bits can be used as kinds of quota flags, this patch will use one of them as the default quota flag.
The global quota record used by default quota will set its soft and hard limit as zero, its grace time will contain the default flag.
Use lfs setquota -U/-G/-P <mnt> to set default quota.
Use lfs setquota -u/-g/-p foo -d <mnt> to set foo to use default quota Use lfs quota -U/-G/-P <mnt> to show default quota.
WC-bug-id: https://jira.whamcloud.com/browse/LU-7816
Lustre-commit: 530881fe4ee2 ("LU-7816 quota: add default quota setting support")
Reviewed-on: https://review.whamcloud.com/32306
--- fs/lustre/llite/dir.c | 4 +++- include/uapi/linux/lustre/lustre_user.h | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
fs/lustre/llite/dir.c +3 -1
@@ -949,10 +949,12 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)switch (cmd) {case Q_SETQUOTA :case Q_SETINFO : +case LUSTRE_Q_SETDEFAULT :if (!capable (CAP_SYS_ADMIN ))return -EPERM ;break ;case Q_GETQUOTA : +case LUSTRE_Q_GETDEFAULT :if (check_owner (type, id) && !capable (CAP_SYS_ADMIN ))return -EPERM ;break ;
@@ -960,7 +962,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)break ;default :CERROR ("unsupported quotactl op: %#x\n" , cmd); -return -ENOTTY ; +return -ENOTSUPP ; }if (valid !=QC_GENERAL ) {
include/uapi/linux/lustre/lustre_user.h +22 -0
@@ -728,6 +728,28 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen)/* lustre-specific control commands */ #define LUSTRE_Q_INVALIDATE 0x80000b/* deprecated as of 2.4 */ #define LUSTRE_Q_FINVALIDATE 0x80000c/* deprecated as of 2.4 */ +#define LUSTRE_Q_GETDEFAULT 0x80000d/* get default quota */ +#define LUSTRE_Q_SETDEFAULT 0x80000e/* set default quota */ + +/* In the current Lustre implementation, the grace time is either the time +* or the timestamp to be used after some quota ID exceeds the soft limt, +* 48 bits should be enough, its high 16 bits can be used as quota flags. +*/ +#define LQUOTA_GRACE_BITS 48 +#define LQUOTA_GRACE_MASK ((1ULL << LQUOTA_GRACE_BITS) - 1) +#define LQUOTA_GRACE_MAX LQUOTA_GRACE_MASK +#define LQUOTA_GRACE (t) (t & LQUOTA_GRACE_MASK) +#define LQUOTA_FLAG (t) (t >> LQUOTA_GRACE_BITS) +#define LQUOTA_GRACE_FLAG (t, f) ((__u64)t | (__u64)f << LQUOTA_GRACE_BITS) + +/* different quota flags */ + +/* the default quota flag, the corresponding quota ID will use the default +* quota setting, the hardlimit and softlimit of its quota record in the global +* quota file will be set to 0, the low 48 bits of the grace will be set to 0 +* and high 16 bits will contain this flag (see above comment). +*/ +#define LQUOTA_FLAG_DEFAULT 0x0001#define ALLQUOTA 255/* set all quota */
Signature · 1 line
1.8.3.1
PATCH 59/622 lustre: ptlrpc: don't zero request handle
In reply to James SimmonsFrom: Alexander Boyko <[email protected]>
LNet can retransmit a request at any time if it isn't replied. The ptlrpc_resend_req zero the request handle and ptlrpc_send_rpc set it. If retransmission happen with zeroed handle, the client can't find a valid export by handle and set rq_export to NULL and reply with ENOTCONN. A server evict client with this error.
client (nid x.x.x.x at tcp) returned error from blocking AST (req status -107 rc -107), evict it
WC-bug-id: https://jira.whamcloud.com/browse/LU-11117
Lustre-commit: 00c72ab6bb43 ("LU-11117 ptlrpc: don't zero request handle")
Cray-bug-id: LUS-6037
Reviewed-on: https://review.whamcloud.com/32781
--- fs/lustre/ptlrpc/client.c | 1 - 1 file changed, 1 deletion(-)
fs/lustre/ptlrpc/client.c +0 -1
@@ -2728,7 +2728,6 @@ void ptlrpc_resend_req(struct ptlrpc_request *req)return ; } -lustre_msg_set_handle (req->rq_reqmsg, &(struct lustre_handle ){0 }); req->rq_status = -EAGAIN ; req->rq_resend =1 ;
Signature · 1 line
1.8.3.1
PATCH 60/622 lnet: ko2iblnd: determine gaps correctly
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
We're allowed to start at a non-aligned page offset in the first fragment and end at a non-aligned page offset in the last fragment.
When checking the iovec exclude both of the first and last fragments from the tx_gaps check.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11064
Lustre-commit: e40ea6fd4494 ("LU-11064 lnd: determine gaps correctly")
Reviewed-on: https://review.whamcloud.com/32586
--- net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +12 -3
@@ -737,6 +737,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,struct kib_net *net = ni->ni_data;struct scatterlist *sg;int fragnob; +int max_nkiov;CDEBUG (D_NET ,"niov %d offset %d nob %d\n" , nkiov, offset, nob);
@@ -751,16 +752,24 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,LASSERT (nkiov >0 ); } + max_nkiov = nkiov; + sg = tx->tx_frags; do { LASSERT(nkiov > 0); fragnob = min((int)(kiov->bv_len - offset), nob); - if ((fragnob < (int)(kiov->bv_len - offset)) && nkiov > 1) { + /* We're allowed to start at a non-aligned page offset in + * the first fragment and end at a non-aligned page offset + * in the last fragment. + */ + if ((fragnob < (int)(kiov->bv_len - offset)) && + nkiov < max_nkiov && nob > fragnob) { CDEBUG(D_NET, - "fragnob %d < available page %d: with remaining %d kiovs\n", - fragnob, (int)(kiov->bv_len - offset), nkiov); + "fragnob %d < available page %d: with remaining %d kiovs with %d nob left\n", + fragnob, (int)(kiov->bv_len - offset), + nkiov, nob); tx->tx_gaps = true; }
Signature · 1 line
1.8.3.1
PATCH 61/622 lustre: osc: increase default max_dirty_mb to 2G
In reply to James SimmonsFrom: Oleg Drokin <[email protected]>
While ideally we want to go away from max_dirty_mb setting completely and let grants code to take the msot part of it, Andreas raises a somewhat valid point that for certain system configurations with high-latency links, system administrators might want to have ability to limit amount of dirty pages just for those OSCs to limit amount of time it might take to flush that dirty data.
So a good compromise is to lift the max_dirty_mb default value first while we work out the current grant code deficiencies
WC-bug-id: https://jira.whamcloud.com/browse/LU-10990
Lustre-commit: 92e2b514e06c ("LU-10990 osc: increase default max_dirty_mb to 2G")
Reviewed-on: https://review.whamcloud.com/32288
--- fs/lustre/include/obd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lustre/include/obd.h +1 -1
@@ -127,7 +127,7 @@ struct timeout_item {#define OBD_MAX_RIF_DEFAULT 8#define OBD_MAX_RIF_MAX 512#define OSC_MAX_RIF_MAX 256 -#define OSC_MAX_DIRTY_DEFAULT (OBD_MAX_RIF_DEFAULT * 4) +#define OSC_MAX_DIRTY_DEFAULT 2000/* Arbitrary large value */ #define OSC_MAX_DIRTY_MB_MAX 2048/* arbitrary, but < MAX_LONG bytes */ #define OSC_DEFAULT_RESENDS 10
Signature · 1 line
1.8.3.1
PATCH 62/622 lustre: ptlrpc: remove obsolete OBD RPC opcodes
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Remove the obsolete OBD_LOG_CANCEL (since Lustre 1.5) and OBD_QC_CALLBACK (since Lustre 2.4) RPC opcodes.
Assign OBD_IDX_READ an explicit opcode (as should be done with all enums in lustre_idl.h) so that the value does not change if some prior field is removed.
Also remove the OBD_FAIL checks that were used to test them. The setting in conf_sanity.sh test_58 was unused for many years.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10855
Lustre-commit: 7d89a5b8aefc ("LU-10855 ptlrpc: remove obsolete OBD RPC opcodes")
Reviewed-on: https://review.whamcloud.com/32651
--- fs/lustre/include/obd_support.h | 6 +++--- fs/lustre/ptlrpc/lproc_ptlrpc.c | 4 ++-- fs/lustre/ptlrpc/wiretest.c | 4 ---- include/uapi/linux/lustre/lustre_idl.h | 12 ++++++------ 4 files changed, 11 insertions(+), 15 deletions(-)
fs/lustre/include/obd_support.h +3 -3
@@ -352,12 +352,12 @@#define OBD_FAIL_PTLRPC_BULK_ATTACH 0x521#define OBD_FAIL_OBD_PING_NET 0x600 -#define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601 +/* OBD_FAIL_OBD_LOG_CANCEL_NET 0x601 obsolete since 1.5 */ #define OBD_FAIL_OBD_LOGD_NET 0x602 -/* OBD_FAIL_OBD_QC_CALLBACK_NET 0x603 obsolete since 2.4 */ +/* OBD_FAIL_OBD_QC_CALLBACK_NET 0x603 obsolete since 2.4 */ #define OBD_FAIL_OBD_DQACQ 0x604#define OBD_FAIL_OBD_LLOG_SETUP 0x605 -#define OBD_FAIL_OBD_LOG_CANCEL_REP 0x606 +/* OBD_FAIL_OBD_LOG_CANCEL_REP 0x606 obsolete since 1.5 */ #define OBD_FAIL_OBD_IDX_READ_NET 0x607#define OBD_FAIL_OBD_IDX_READ_BREAK 0x608#define OBD_FAIL_OBD_NO_LRU 0x609
fs/lustre/ptlrpc/lproc_ptlrpc.c +2 -2
@@ -111,8 +111,8 @@ { MGS_SET_INFO, "mgs_set_info" }, { MGS_CONFIG_READ, "mgs_config_read" }, { OBD_PING, "obd_ping" }, - { OBD_LOG_CANCEL, "llog_cancel" }, - { OBD_QC_CALLBACK, "obd_quota_callback" }, + { 401, /* was OBD_LOG_CANCEL */ "llog_cancel" }, + { 402, /* was OBD_QC_CALLBACK */ "obd_quota_callback" }, { OBD_IDX_READ, "dt_index_read" }, { LLOG_ORIGIN_HANDLE_CREATE, "llog_origin_handle_open" }, { LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "llog_origin_handle_next_block" },
fs/lustre/ptlrpc/wiretest.c +0 -4
@@ -326,10 +326,6 @@ void lustre_assert_wire_constants(void)BUILD_BUG_ON (LUSTRE_RES_ID_HSH_OFF !=3 );LASSERTF (OBD_PING ==400 ,"found %lld\n" , (long long )OBD_PING ); -LASSERTF (OBD_LOG_CANCEL ==401 ,"found %lld\n" , - (long long )OBD_LOG_CANCEL ); -LASSERTF (OBD_QC_CALLBACK ==402 ,"found %lld\n" , - (long long )OBD_QC_CALLBACK );LASSERTF (OBD_IDX_READ ==403 ,"found %lld\n" , (long long )OBD_IDX_READ ); LASSERTF(OBD_LAST_OPC == 404, "found %lld\n",
include/uapi/linux/lustre/lustre_idl.h +6 -6
@@ -2342,13 +2342,13 @@ struct cfg_marker {*/ enum obd_cmd { -OBD_PING =400 , -OBD_LOG_CANCEL ,/* Obsolete since 1.5. */ -OBD_QC_CALLBACK ,/* not used since 2.4 */ -OBD_IDX_READ , -OBD_LAST_OPC +OBD_PING =400 , +/* OBD_LOG_CANCEL = 401, Obsolete since 1.5 */ +/* OBD_QC_CALLBACK = 402, not used since 2.4 */ +OBD_IDX_READ =403 , +OBD_LAST_OPC , +OBD_FIRST_OPC =OBD_PING }; -#define OBD_FIRST_OPC OBD_PING/** * llog contexts indices.
Signature · 1 line
1.8.3.1
PATCH 63/622 lustre: ptlrpc: assign specific values to MGS opcodes
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Assign specific values to all of the MGS opcodes in enum mgs_cmd so that these values do not change if a new items is added or one is removed in the future. These opcodes are part of the wire protocol and need to remain constant.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10855
Lustre-commit: 12c5a26609f1 ("LU-10855 ptlrpc: assign specific values to MGS opcodes")
Reviewed-on: https://review.whamcloud.com/32653
--- fs/lustre/ptlrpc/wiretest.c | 2 ++ include/uapi/linux/lustre/lustre_idl.h | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-)
fs/lustre/ptlrpc/wiretest.c +2 -0
@@ -348,6 +348,8 @@ void lustre_assert_wire_constants(void) (long long)MGS_TARGET_DEL);LASSERTF (MGS_SET_INFO ==255 ,"found %lld\n" , (long long )MGS_SET_INFO ); +LASSERTF (MGS_CONFIG_READ ==256 ,"found %lld\n" , + (long long )MGS_CONFIG_READ );LASSERTF (MGS_LAST_OPC ==257 ,"found %lld\n" , (long long )MGS_LAST_OPC ); LASSERTF(SEC_CTX_INIT == 801, "found %lld\n",
include/uapi/linux/lustre/lustre_idl.h +10 -10
@@ -2247,16 +2247,16 @@ struct ldlm_reply {* Opcodes for mountconf (mgs and mgc) */ enum mgs_cmd { -MGS_CONNECT =250 , -MGS_DISCONNECT , -MGS_EXCEPTION ,/* node died, etc. */ -MGS_TARGET_REG ,/* whenever target starts up */ -MGS_TARGET_DEL , -MGS_SET_INFO , -MGS_CONFIG_READ , -MGS_LAST_OPC -}; -#define MGS_FIRST_OPC MGS_CONNECT +MGS_CONNECT =250 , +MGS_DISCONNECT =251 , +MGS_EXCEPTION =252 ,/* node died, etc. */ +MGS_TARGET_REG =253 ,/* whenever target starts up */ +MGS_TARGET_DEL =254 , +MGS_SET_INFO =255 , +MGS_CONFIG_READ =256 , +MGS_LAST_OPC , +MGS_FIRST_OPC =MGS_CONNECT +};#define MGS_PARAM_MAXLEN 1024#define KEY_SET_INFO "set_info"
Signature · 1 line
1.8.3.1
PATCH 64/622 lustre: ptlrpc: remove obsolete LLOG_ORIGIN_* RPCs
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Remove the obsolete RPC opcodes LLOG_ORIGIN_HANDLE_WRITE_REC, LLOG_ORIGIN_HANDLE_CLOSE, LLOG_ORIGIN_CONNECT, LLOG_CATINFO along with their unused OBD_FAIL counterparts.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10855
Lustre-commit: 830ce1b10f3a ("LU-10855 ptlrpc: remove obsolete LLOG_ORIGIN_* RPCs")
Reviewed-on: https://review.whamcloud.com/32654
--- fs/lustre/include/obd_support.h | 10 +++++----- fs/lustre/ptlrpc/lproc_ptlrpc.c | 8 ++++---- fs/lustre/ptlrpc/wiretest.c | 5 ----- include/uapi/linux/lustre/lustre_idl.h | 10 +++++----- 4 files changed, 14 insertions(+), 19 deletions(-)
fs/lustre/include/obd_support.h +5 -5
@@ -423,15 +423,15 @@#define OBD_FAIL_SEC_CTX_HDL_PAUSE 0x1204#define OBD_FAIL_LLOG 0x1300 -#define OBD_FAIL_LLOG_ORIGIN_CONNECT_NET 0x1301 +/* was OBD_FAIL_LLOG_ORIGIN_CONNECT_NET 0x1301 until 2.4 */ #define OBD_FAIL_LLOG_ORIGIN_HANDLE_CREATE_NET 0x1302 -#define OBD_FAIL_LLOG_ORIGIN_HANDLE_DESTROY_NET 0x1303 +/* was OBD_FAIL_LLOG_ORIGIN_HANDLE_DESTROY_NET 0x1303 until 2.11 */ #define OBD_FAIL_LLOG_ORIGIN_HANDLE_READ_HEADER_NET 0x1304#define OBD_FAIL_LLOG_ORIGIN_HANDLE_NEXT_BLOCK_NET 0x1305#define OBD_FAIL_LLOG_ORIGIN_HANDLE_PREV_BLOCK_NET 0x1306 -#define OBD_FAIL_LLOG_ORIGIN_HANDLE_WRITE_REC_NET 0x1307 -#define OBD_FAIL_LLOG_ORIGIN_HANDLE_CLOSE_NET 0x1308 -#define OBD_FAIL_LLOG_CATINFO_NET 0x1309 +/* was OBD_FAIL_LLOG_ORIGIN_HANDLE_WRITE_REC_NET 0x1307 until 2.1 */ +/* was OBD_FAIL_LLOG_ORIGIN_HANDLE_CLOSE_NET 0x1308 until 1.8 */ +/* was OBD_FAIL_LLOG_CATINFO_NET 0x1309 until 2.3 */ #define OBD_FAIL_MDS_SYNC_CAPA_SL 0x1310#define OBD_FAIL_SEQ_ALLOC 0x1311
fs/lustre/ptlrpc/lproc_ptlrpc.c +4 -4
@@ -117,10 +117,10 @@ { LLOG_ORIGIN_HANDLE_CREATE, "llog_origin_handle_open" }, { LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "llog_origin_handle_next_block" }, { LLOG_ORIGIN_HANDLE_READ_HEADER, "llog_origin_handle_read_header" }, - { LLOG_ORIGIN_HANDLE_WRITE_REC, "llog_origin_handle_write_rec" }, - { LLOG_ORIGIN_HANDLE_CLOSE, "llog_origin_handle_close" }, - { LLOG_ORIGIN_CONNECT, "llog_origin_connect" }, - { LLOG_CATINFO, "llog_catinfo" }, + { 504, /*LLOG_ORIGIN_HANDLE_WRITE_REC*/ "llog_origin_handle_write_rec" }, + { 505, /* was LLOG_ORIGIN_HANDLE_CLOSE */"llog_origin_handle_close" }, + { 506, /* was LLOG_ORIGIN_CONNECT */ "llog_origin_connect" }, + { 507, /* was LLOG_CATINFO */ "llog_catinfo" }, { LLOG_ORIGIN_HANDLE_PREV_BLOCK, "llog_origin_handle_prev_block" }, { LLOG_ORIGIN_HANDLE_DESTROY, "llog_origin_handle_destroy" }, { QUOTA_DQACQ, "quota_acquire" },
fs/lustre/ptlrpc/wiretest.c +0 -5
@@ -3757,12 +3757,7 @@ void lustre_assert_wire_constants(void)BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_CREATE !=501 );BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_NEXT_BLOCK !=502 );BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_READ_HEADER !=503 ); -BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_WRITE_REC !=504 ); -BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_CLOSE !=505 ); -BUILD_BUG_ON (LLOG_ORIGIN_CONNECT !=506 ); -BUILD_BUG_ON (LLOG_CATINFO !=507 );BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_PREV_BLOCK !=508 ); -BUILD_BUG_ON (LLOG_ORIGIN_HANDLE_DESTROY !=509 );BUILD_BUG_ON (LLOG_FIRST_OPC !=501 );BUILD_BUG_ON (LLOG_LAST_OPC !=510 );BUILD_BUG_ON (LLOG_CONFIG_ORIG_CTXT !=0 );
include/uapi/linux/lustre/lustre_idl.h +5 -5
@@ -2655,12 +2655,12 @@ enum llogd_rpc_ops {LLOG_ORIGIN_HANDLE_CREATE =501 ,LLOG_ORIGIN_HANDLE_NEXT_BLOCK =502 ,LLOG_ORIGIN_HANDLE_READ_HEADER =503 , -LLOG_ORIGIN_HANDLE_WRITE_REC =504 ,/* Obsolete by 2.1. */ -LLOG_ORIGIN_HANDLE_CLOSE =505 ,/* Obsolete by 1.8. */ -LLOG_ORIGIN_CONNECT =506 ,/* Obsolete by 2.4. */ -LLOG_CATINFO =507 ,/* Obsolete by 2.3. */ +/* LLOG_ORIGIN_HANDLE_WRITE_REC = 504, Obsolete by 2.1. */ +/* LLOG_ORIGIN_HANDLE_CLOSE = 505, Obsolete by 1.8. */ +/* LLOG_ORIGIN_CONNECT = 506, Obsolete by 2.4. */ +/* LLOG_CATINFO = 507, Obsolete by 2.3. */ LLOG_ORIGIN_HANDLE_PREV_BLOCK =508 , -LLOG_ORIGIN_HANDLE_DESTROY =509 ,/* Obsolete. */ +LLOG_ORIGIN_HANDLE_DESTROY =509 ,/* Obsolete by 2.11. */ LLOG_LAST_OPC , LLOG_FIRST_OPC = LLOG_ORIGIN_HANDLE_CREATE };
Signature · 1 line
1.8.3.1
PATCH 65/622 lustre: osc: fix idle_timeout handling
In reply to James SimmonsThe patch that landed for LU-7236 introduced new sysfs entries which were done wrong.
1) For idle_timeout it returns -ERANGE for
any value passed in expect setting idle_timeout to zero. This does not match what the commit message said for LU-7236. So I changed lprocfs_str_with_units_to_s64() into kstrtouint() since a signed 64 bit timeout is not needed. Using kstrtouint() ensures that negative values are not possible and also cap the value to CONNECTION_SWITCH_MAX since the max of 4 billion seconds is over kill.
2) For the next procfs idle_connect it is really a write only file but it was treated as both read and write. There is no need for the osc_idle_connect_seq_show() function.
3) Lastly no more stuffing new entries into proc or debugfs. For this patch convert these new proc entries to sysfs. It seems to be a common occurrence so add LPROC_SEQ_* to spelling.txt so checkpatch will complain about using LPROC_SEQ_* which will go away.
WC-bug-id: https://jira.whamcloud.com/browse/LU-8066
Lustre-commit: 406cd8a74d84 ("LU-8066 osc: fix idle_timeout handling")
Reviewed-on: https://review.whamcloud.com/32719
--- fs/lustre/osc/lproc_osc.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-)
fs/lustre/osc/lproc_osc.c +18 -24
@@ -598,26 +598,27 @@ static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)LPROC_SEQ_FOPS_RO (osc_unstable_stats); -static int osc_idle_timeout_seq_show (struct seq_file *m,void *v) +static ssize_t idle_timeout_show (struct kobject *kobj,struct attribute *attr, +char *buf) { -struct obd_device *obd = m->private; + struct obd_device *obd = container_of(kobj, struct obd_device, + obd_kset.kobj);struct client_obd *cli = &obd->u.cli; -seq_printf (m,"%u\n" , cli->cl_import->imp_idle_timeout); -return 0 ; +return sprintf (buf,"%u\n" , cli->cl_import->imp_idle_timeout); } -static ssize_t osc_idle_timeout_seq_write (struct file *f, -const char __user *buffer, -size_t count,loff_t *off) +static ssize_t idle_timeout_store (struct kobject *kobj,struct attribute *attr, +const char *buffer,size_t count) { -struct obd_device *obd = ((struct seq_file *)f->private_data)->private; + struct obd_device *obd = container_of(kobj, struct obd_device, + obd_kset.kobj);struct client_obd *cli = &obd->u.cli;struct ptlrpc_request *req;unsigned int val;int rc; - rc =kstrtouint_from_user (buffer, count,0 , &val); + rc =kstrtouint (buffer,0 , &val);if (rc)return rc;
@@ -635,18 +636,13 @@ static ssize_t osc_idle_timeout_seq_write(struct file *f,return count; } -LPROC_SEQ_FOPS (osc_idle_timeout); +LUSTRE_RW_ATTR (idle_timeout); -static int osc_idle_connect_seq_show (struct seq_file *m,void *v) +static ssize_t idle_connect_store (struct kobject *kobj,struct attribute *attr, +const char *buffer,size_t count) { -return 0 ; -} - -static ssize_t osc_idle_connect_seq_write (struct file *f, -const char __user *buffer, -size_t count,loff_t *off) -{ -struct obd_device *dev = ((struct seq_file *)f->private_data)->private; + struct obd_device *dev = container_of(kobj, struct obd_device, + obd_kset.kobj);struct client_obd *cli = &dev->u.cli;struct ptlrpc_request *req;
@@ -658,7 +654,7 @@ static ssize_t osc_idle_connect_seq_write(struct file *f,return count; } -LPROC_SEQ_FOPS (osc_idle_connect); +LUSTRE_WO_ATTR (idle_connect);LPROC_SEQ_FOPS_RO_TYPE (osc, connect_flags);LPROC_SEQ_FOPS_RO_TYPE (osc, server_uuid);
@@ -687,10 +683,6 @@ static ssize_t osc_idle_connect_seq_write(struct file *f, .fops = &osc_pinger_recov_fops }, { .name = "unstable_stats", .fops = &osc_unstable_stats_fops }, - { .name = "idle_timeout", - .fops = &osc_idle_timeout_fops }, - { .name = "idle_connect", - .fops = &osc_idle_connect_fops }, { NULL } };
@@ -877,6 +869,8 @@ void lproc_osc_attach_seqstat(struct obd_device *dev) &lustre_attr_resend_count.attr, &lustre_attr_ost_conn_uuid.attr, &lustre_attr_ping.attr, + &lustre_attr_idle_timeout.attr, + &lustre_attr_idle_connect.attr, NULL, };
Signature · 1 line
1.8.3.1
PATCH 66/622 lustre: ptlrpc: ASSERTION(!list_empty(imp->imp_replay_cursor))
In reply to James SimmonsFrom: Andriy Skulysh <[email protected]>
It's ptlrpc_replay_next() vs close race. ll_close_inode_openhandle() calls mdc_free_open()->ptlrpc_request_committed->ptlrpc_free_request
Need to reset imp_replay_cursor while dropping a request from replay list.
Cray-bug-id: LUS-2455
WC-bug-id: https://jira.whamcloud.com/browse/LU-11098
Lustre-commit: d69d488e1778 ("LU-11098 ptlrpc: ASSERTION(!list_empty(imp->imp_replay_cursor))")
Reviewed-on: https://review.whamcloud.com/32727
--- fs/lustre/ptlrpc/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/lustre/ptlrpc/client.c +4 -1
@@ -2613,8 +2613,11 @@ void ptlrpc_request_committed(struct ptlrpc_request *req, int force)return ; } -if (force || req->rq_transno <= imp->imp_peer_committed_transno) +if (force || req->rq_transno <= imp->imp_peer_committed_transno) { +if (imp->imp_replay_cursor == &req->rq_replay_list) + imp->imp_replay_cursor = req->rq_replay_list.next;ptlrpc_free_request (req); + }spin_unlock (&imp->imp_lock); }
Signature · 1 line
1.8.3.1
PATCH 67/622 lustre: obd: keep dirty_max_pages a round number of MB
In reply to James SimmonsFrom: "John L. Hammond" <[email protected]>
In client_adjust_max_dirty() ensure that the dirty pages limit is always divisible by 256 so that it may faithfully be represented in MB as is the case when the max_dirty_mb parameters are used.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11157
Lustre-commit: d3f88d376c49 ("LU-11157 obd: keep dirty_max_pages a round number of MB")
Reviewed-on: https://review.whamcloud.com/32831
--- fs/lustre/include/obd.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
fs/lustre/include/obd.h +10 -3
@@ -1106,7 +1106,7 @@ static inline int cli_brw_size(struct obd_device *obd) }/* -* when RPC size or the max RPCs in flight is increased, the max dirty pages +* When RPC size or the max RPCs in flight is increased, the max dirty pages * of the client should be increased accordingly to avoid sending fragmented * RPCs over the network when the client runs out of the maximum dirty space * when so many RPCs are being generated.
@@ -1114,10 +1114,10 @@ static inline int cli_brw_size(struct obd_device *obd)static inline void client_adjust_max_dirty (struct client_obd *cli) {/* initializing */ -if (cli->cl_dirty_max_pages <=0 ) +if (cli->cl_dirty_max_pages <=0 ) { cli->cl_dirty_max_pages = (OSC_MAX_DIRTY_DEFAULT *1024 *1024 ) >>PAGE_SHIFT ; -else { + }else {unsigned long dirty_max = cli->cl_max_rpcs_in_flight * cli->cl_max_pages_per_rpc;
@@ -1127,6 +1127,13 @@ static inline void client_adjust_max_dirty(struct client_obd *cli)if (cli->cl_dirty_max_pages >totalram_pages () /8 ) cli->cl_dirty_max_pages =totalram_pages () /8 ; + +/* This value is exported to userspace through the max_dirty_mb +* parameter. So we round up the number of pages to make it a round +* number of MBs. +*/ + cli->cl_dirty_max_pages =round_up (cli->cl_dirty_max_pages, + 1 << (20 - PAGE_SHIFT)); }#endif /* __OBD_H */
Signature · 1 line
1.8.3.1
PATCH 68/622 lustre: osc: depart grant shrinking from pinger
In reply to James SimmonsFrom: Bobi Jam <[email protected]>
* Removing grant shrinking code outside of pinger, use a workqueue to handle grant shrinking timer.
* Enable OSC grant shrinking by default.
bugzilla: 19507
WC-bug-id: https://jira.whamcloud.com/browse/LU-8708
Lustre-commit: fc915a43786e ("LU-8708 osc: depart grant shrinking from pinger")
Reviewed-on: https://review.whamcloud.com/23202
--- fs/lustre/ldlm/ldlm_lib.c | 1 + fs/lustre/llite/llite_lib.c | 2 +- fs/lustre/osc/osc_request.c | 155 ++++++++++++++++++++++++++++++-------------- 3 files changed, 110 insertions(+), 48 deletions(-)
fs/lustre/ldlm/ldlm_lib.c +1 -0
@@ -349,6 +349,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)spin_lock_init (&cli->cl_lru_list_lock);atomic_long_set (&cli->cl_unstable_count,0 );INIT_LIST_HEAD (&cli->cl_shrink_list); +INIT_LIST_HEAD (&cli->cl_grant_chain);INIT_LIST_HEAD (&cli->cl_flight_waiters); cli->cl_rpcs_in_flight =0 ;
fs/lustre/llite/llite_lib.c +1 -1
@@ -399,7 +399,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)OBD_CONNECT_LAYOUTLOCK |OBD_CONNECT_PINGLESS |OBD_CONNECT_LFSCK |OBD_CONNECT_BULK_MBITS |OBD_CONNECT_SHORTIO | -OBD_CONNECT_FLAGS2 ; +OBD_CONNECT_FLAGS2 |OBD_CONNECT_GRANT_SHRINK ;/* The client currently advertises support for OBD_CONNECT_LOCKAHEAD_OLD * so it can interoperate with an older version of lockahead which was
fs/lustre/osc/osc_request.c +108 -47
246 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 69/622 lustre: mdt: Lazy size on MDT
In reply to James SimmonsFrom: Qian Yingjin <[email protected]>
The design of Lazy size on MDT (LSOM) does not guarantee the accuracy. A file that is being opened for a long time might cause inaccurate LSOM for a very long time. And also eviction or crash of client might cause incomplete process of closing a file, thus might cause inaccurate LSOM. A precise LSOM could only be read from MDT when 1) all possible corruption and inconsistency caused by client eviction or client/server crash have all been fixed by LFSCK and 2) the file is not being opened for write.
In the first step of implementing LSOM, LSOM will not be accessible from client. Instead, LSOM values can only be accessed on MDT. Thus, no interface or logic codes will be added on client side to enabled the access of LSOM from client side.
The LSOM will be saved as an EA value on MDT.
LSOM includes both the apparent size and also the disk usage of the file.
Whenever a file is being truncated, the LSOM of the file on MDT will be updated.
Whenever a client is closing a file, ll_prepare_close() will send the size and blocks to the MDS. The MDS will update the LSOM of the file if the file size or block size is being increased.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9538
Lustre-commit: f1ebf88aef21 ("LU-9538 mdt: Lazy size on MDT")
Reviewed-on: https://review.whamcloud.com/29960
--- fs/lustre/include/obd.h | 4 +++- fs/lustre/llite/file.c | 5 +++++ fs/lustre/mdc/mdc_lib.c | 4 ++++ fs/lustre/ptlrpc/wiretest.c | 24 ++++++++++++++++++++++++ include/uapi/linux/lustre/lustre_idl.h | 2 ++ include/uapi/linux/lustre/lustre_user.h | 17 +++++++++++++++-- 6 files changed, 53 insertions(+), 3 deletions(-)
fs/lustre/include/obd.h +3 -1
@@ -204,7 +204,7 @@ struct client_obd {long cl_reserved_grant;wait_queue_head_t cl_cache_waiters;/* waiting for cache/grant */ time64_t cl_next_shrink_grant;/* seconds */ -struct list_head cl_grant_shrink_list;/* Timeout event list */ +struct list_head cl_grant_chain;time64_t cl_grant_shrink_interval;/* seconds */ /* A chunk is an optimal size used by osc_extent to determine
@@ -670,6 +670,8 @@ enum op_xvalid {OP_XVALID_OWNEROVERRIDE =BIT (2 ),/* 0x0004 */ OP_XVALID_FLAGS =BIT (3 ),/* 0x0008 */ OP_XVALID_PROJID =BIT (4 ),/* 0x0010 */ +OP_XVALID_LAZYSIZE =BIT (5 ),/* 0x0020 */ + OP_XVALID_LAZYBLOCKS = BIT(6), /* 0x0040 */ };struct lu_context ;
fs/lustre/llite/file.c +5 -0
@@ -207,6 +207,11 @@ static int ll_close_inode_openhandle(struct inode *inode,break ; } +if (!(op_data->op_attr.ia_valid &ATTR_SIZE )) + op_data->op_xvalid |=OP_XVALID_LAZYSIZE ; +if (!(op_data->op_xvalid &OP_XVALID_BLOCKS )) + op_data->op_xvalid |=OP_XVALID_LAZYBLOCKS ; + rc =md_close (md_exp, op_data, och->och_mod, &req);if (rc && rc != -EINTR ) { CERROR("%s: inode " DFID " mdc close failed: rc = %d\n",
fs/lustre/mdc/mdc_lib.c +4 -0
@@ -317,6 +317,10 @@ static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid) sa_valid |=MDS_OPEN_OWNEROVERRIDE ;if (ia_xvalid &OP_XVALID_PROJID ) sa_valid |=MDS_ATTR_PROJID ; +if (ia_xvalid &OP_XVALID_LAZYSIZE ) + sa_valid |=MDS_ATTR_LSIZE ; +if (ia_xvalid &OP_XVALID_LAZYBLOCKS ) + sa_valid |=MDS_ATTR_LBLOCKS ;return sa_valid; }
fs/lustre/ptlrpc/wiretest.c +24 -0
@@ -258,6 +258,10 @@ void lustre_assert_wire_constants(void)LASSERTF (MDS_ATTR_PROJID ==0x0000000000010000ULL ,"found 0x%.16llxULL\n" , (long long )MDS_ATTR_PROJID ); +LASSERTF (MDS_ATTR_LSIZE ==0x0000000000020000ULL ,"found 0x%.16llxULL\n" , + (long long )MDS_ATTR_LSIZE ); +LASSERTF (MDS_ATTR_LBLOCKS ==0x0000000000040000ULL ,"found 0x%.16llxULL\n" , + (long long )MDS_ATTR_LBLOCKS );LASSERTF (FLD_QUERY ==900 ,"found %lld\n" , (long long )FLD_QUERY ); LASSERTF(FLD_FIRST_OPC == 900, "found %lld\n",
@@ -390,6 +394,26 @@ void lustre_assert_wire_constants(void)LASSERTF (LU_SEQ_RANGE_OST ==1 ,"found %lld\n" , (long long )LU_SEQ_RANGE_OST ); +/* Checks for struct lustre_som_attrs */ +LASSERTF ((int )sizeof (struct lustre_som_attrs ) ==24 ,"found %lld\n" , + (long long )(int )sizeof (struct lustre_som_attrs )); +LASSERTF ((int )offsetof(struct lustre_som_attrs , lsa_valid) ==0 ,"found %lld\n" , + (long long )(int )offsetof(struct lustre_som_attrs , lsa_valid)); +LASSERTF ((int )sizeof (((struct lustre_som_attrs *)0 )->lsa_valid) ==2 ,"found %lld\n" , + (long long )(int )sizeof (((struct lustre_som_attrs *)0 )->lsa_valid)); +LASSERTF ((int )offsetof(struct lustre_som_attrs , lsa_reserved) ==2 ,"found %lld\n" , + (long long )(int )offsetof(struct lustre_som_attrs , lsa_reserved)); +LASSERTF ((int )sizeof (((struct lustre_som_attrs *)0 )->lsa_reserved) ==6 ,"found %lld\n" , + (long long )(int )sizeof (((struct lustre_som_attrs *)0 )->lsa_reserved)); +LASSERTF ((int )offsetof(struct lustre_som_attrs , lsa_size) ==8 ,"found %lld\n" , + (long long )(int )offsetof(struct lustre_som_attrs , lsa_size)); +LASSERTF ((int )sizeof (((struct lustre_som_attrs *)0 )->lsa_size) ==8 ,"found %lld\n" , + (long long )(int )sizeof (((struct lustre_som_attrs *)0 )->lsa_size)); +LASSERTF ((int )offsetof(struct lustre_som_attrs , lsa_blocks) ==16 ,"found %lld\n" , + (long long )(int )offsetof(struct lustre_som_attrs , lsa_blocks)); +LASSERTF ((int )sizeof (((struct lustre_som_attrs *)0 )->lsa_blocks) ==8 ,"found %lld\n" , + (long long )(int )sizeof (((struct lustre_som_attrs *)0 )->lsa_blocks)); +/* Checks for struct lustre_mdt_attrs */ LASSERTF ((int )sizeof (struct lustre_mdt_attrs ) ==24 ,"found %lld\n" , (long long )(int )sizeof (struct lustre_mdt_attrs ));
include/uapi/linux/lustre/lustre_idl.h +2 -0
@@ -1676,6 +1676,8 @@ struct mdt_rec_setattr {*/ #define MDS_ATTR_BLOCKS 0x8000ULL/* = 32768 */ #define MDS_ATTR_PROJID 0x10000ULL/* = 65536 */ +#define MDS_ATTR_LSIZE 0x20000ULL/* = 131072 */ +#define MDS_ATTR_LBLOCKS 0x40000ULL/* = 262144 */ enum mds_op_bias {/* MDS_CHECK_SPLIT = 1 << 0, obsolete before 2.3.58 */
include/uapi/linux/lustre/lustre_user.h +15 -2
@@ -202,8 +202,19 @@ struct lustre_mdt_attrs {*/ #define LMA_OLD_SIZE (sizeof(struct lustre_mdt_attrs) + 5 * sizeof(__u64)) -enum { -LSOM_FL_VALID =1 <<0 , +enum lustre_som_flags { +/* Unknown or no SoM data, must get size from OSTs. */ +SOM_FL_UNKNOWN =0x0000 , +/* Known strictly correct, FLR or DoM file (SoM guaranteed). */ +SOM_FL_STRICT =0x0001 , +/* Known stale - was right@some point in the past, but it is +* known (or likely) to be incorrect now (e.g. opened for write). +*/ +SOM_FL_STALE =0x0002 , +/* Approximate, may never have been strictly correct, +* need to sync SOM data to achieve eventual consistency. +*/ +SOM_FL_LAZY =0x0004 , };struct lustre_som_attrs {
@@ -882,6 +893,8 @@ enum la_valid {LA_KILL_SGID =1 <<14 ,LA_PROJID =1 <<15 ,LA_LAYOUT_VERSION =1 <<16 , +LA_LSIZE =1 <<17 , + LA_LBLOCKS = 1 << 18,/** * Attributes must be transmitted to OST objects */
Signature · 1 line
1.8.3.1
PATCH 70/622 lustre: lfsck: layout LFSCK for mirrored file
In reply to James SimmonsFrom: Fan Yong <[email protected]>
This patch makes the layout LFSCK to support mirrored file as following:
1. Verify mirrored file's LOV EA and PFID EA, including all kinds of inconsistencies as non-mirrored file may hit.
2. Rebuild mirrored file's LOV EA from orphan OST-objects, recover the component's status/flags before the crash:
init, stale, and so on.
3. For the mirrored file with dangling reference (OST object), it does NOT rebuild the lost OST-object from other replica, instead, it either reports the curruption or re-create empty OST-object that follows the same rules as non-mirrored case.
Some code cleanup and new test cases for LFSCK against mirrored file.
For the linux client we want to keep the wire protocol in sync.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10288
Lustre-commit: 36ba989752c6 ("LU-10288 lfsck: layout LFSCK for mirrored file")
Reviewed-on: https://review.whamcloud.com/32705
--- fs/lustre/ptlrpc/pack_generic.c | 4 +++- fs/lustre/ptlrpc/wiretest.c | 16 ++++++++++++---- include/uapi/linux/lustre/lustre_user.h | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-)
fs/lustre/ptlrpc/pack_generic.c +3 -1
@@ -2066,7 +2066,9 @@ void lustre_swab_lov_comp_md_v1(struct lov_comp_md_v1 *lum)__swab64s (&ent->lcme_extent.e_end);__swab32s (&ent->lcme_offset);__swab32s (&ent->lcme_size); - BUILD_BUG_ON(offsetof(typeof(*ent), lcme_padding) == 0); +__swab32s (&ent->lcme_layout_gen); + BUILD_BUG_ON(offsetof(typeof(*ent), lcme_padding_1) == 0); + BUILD_BUG_ON(offsetof(typeof(*ent), lcme_padding_2) == 0); v1 = (struct lov_user_md_v1 *)((char *)lum + off); stripe_count = v1->lmm_stripe_count;
fs/lustre/ptlrpc/wiretest.c +12 -4
@@ -1536,10 +1536,18 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct lov_comp_md_entry_v1, lcme_size));LASSERTF ((int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_size) ==4 ,"found %lld\n" , (long long )(int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_size)); -LASSERTF ((int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding) ==32 ,"found %lld\n" , - (long long )(int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding)); -LASSERTF ((int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding) ==16 ,"found %lld\n" , - (long long )(int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding)); +LASSERTF ((int )offsetof(struct lov_comp_md_entry_v1 , lcme_layout_gen) ==32 ,"found %lld\n" , + (long long )(int )offsetof(struct lov_comp_md_entry_v1 , lcme_layout_gen)); +LASSERTF ((int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_layout_gen) ==4 ,"found %lld\n" , + (long long )(int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_layout_gen)); +LASSERTF ((int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding_1) ==36 ,"found %lld\n" , + (long long )(int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding_1)); +LASSERTF ((int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding_1) ==4 ,"found %lld\n" , + (long long )(int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding_1)); +LASSERTF ((int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding_2) ==40 ,"found %lld\n" , + (long long )(int )offsetof(struct lov_comp_md_entry_v1 , lcme_padding_2)); +LASSERTF ((int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding_2) ==8 ,"found %lld\n" , + (long long )(int )sizeof (((struct lov_comp_md_entry_v1 *)0 )->lcme_padding_2));LASSERTF (LCME_FL_INIT ==0x00000010UL ,"found 0x%.8xUL\n" , (unsigned int )LCME_FL_INIT ); LASSERTF(LCME_FL_NEG == 0x80000000UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_user.h +3 -1
@@ -517,7 +517,9 @@ struct lov_comp_md_entry_v1 {* start from lov_comp_md_v1 */ __u32 lcme_size;/* size of component blob */ -__u64 lcme_padding[2 ]; +__u32 lcme_layout_gen; +__u32 lcme_padding_1; +__u64 lcme_padding_2; } __packed;#define SEQ_ID_MAX 0x0000FFFF
Signature · 1 line
1.8.3.1
PATCH 71/622 lustre: mdt: read on open for DoM files
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
Read file data upon open and return it in reply. That works only for file with Data-on-MDT layout and no OST components initialized. There are three possible cases may occur:
1) file data fits in already allocated reply buffer (~9K) and is returned in that buffer in OPEN reply.
2) File fits in the maximum reply buffer (128K) and reply is returned with larger size to the client causing resend with re-allocated buffer.
3) File doesn't fit in reply buffer but its tail fills page partially then that tail is returned. This can be useful for an append case
WC-bug-id: https://jira.whamcloud.com/browse/LU-10181
Lustre-commit: 13372d6c243c ("LU-10181 mdt: read on open for DoM files")
Reviewed-on: https://review.whamcloud.com/23011
--- fs/lustre/include/lustre_req_layout.h | 1 + fs/lustre/include/obd.h | 11 +++ fs/lustre/llite/file.c | 131 +++++++++++++++++++++++++++++++++- fs/lustre/llite/llite_internal.h | 3 + fs/lustre/llite/namei.c | 3 + fs/lustre/mdc/lproc_mdc.c | 32 +++++++++ fs/lustre/mdc/mdc_internal.h | 4 ++ fs/lustre/mdc/mdc_locks.c | 28 +++++++- fs/lustre/mdc/mdc_request.c | 2 + fs/lustre/ptlrpc/layout.c | 11 ++- fs/lustre/ptlrpc/niobuf.c | 5 ++ 11 files changed, 227 insertions(+), 4 deletions(-)
fs/lustre/include/lustre_req_layout.h +1 -0
@@ -291,6 +291,7 @@ void req_capsule_shrink(struct req_capsule *pill,extern struct req_msg_field RMF_OBD_ID ;extern struct req_msg_field RMF_FID ;extern struct req_msg_field RMF_NIOBUF_REMOTE ; +extern struct req_msg_field RMF_NIOBUF_INLINE ;extern struct req_msg_field RMF_RCS ;extern struct req_msg_field RMF_FIEMAP_KEY ;extern struct req_msg_field RMF_FIEMAP_VAL ;
fs/lustre/include/obd.h +11 -0
@@ -184,6 +184,17 @@ struct client_obd {*/ u32 cl_max_mds_easize; +/* Data-on-MDT specific value to set larger reply buffer for possible +* data read along with open/stat requests. By default it tries to use +* unused space in reply buffer. +* This value is used to ensure that reply buffer has at least as +* much free space as value indicates. That free space is gained from +* LOV EA buffer which is small for DoM files and on big systems can +* provide up to 32KB of extra space in reply buffer. +* Default value is 8K now. +*/ +u32 cl_dom_min_inline_repsize; +enum lustre_sec_part cl_sp_me;enum lustre_sec_part cl_sp_to;struct sptlrpc_flavor cl_flvr_mgc;/* fixed flavor of mgc->mgs */
fs/lustre/llite/file.c +130 -1
144 lines not on this page · raw message
fs/lustre/llite/llite_internal.h +3 -0
@@ -916,6 +916,9 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,ssize_t ll_copy_user_md (const struct lov_user_md __user *md,struct lov_user_md **kbuf); +void ll_dom_finish_open (struct inode *inode,struct ptlrpc_request *req, +struct lookup_intent *it); +/* Compute expected user md size when passing in a md from user space */ static inline ssize_t ll_lov_user_md_size (const struct lov_user_md *lum) {
fs/lustre/llite/namei.c +3 -0
@@ -600,6 +600,9 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,if (rc)return rc; +if (it->it_op &IT_OPEN ) +ll_dom_finish_open (inode, request, it); +ll_set_lock_data (ll_i2sbi (parent)->ll_md_exp, inode, it, &bits);/* We used to query real size from OSTs here, but actually
fs/lustre/mdc/lproc_mdc.c +32 -0
@@ -456,6 +456,36 @@ static ssize_t mdc_stats_seq_write(struct file *file, }LPROC_SEQ_FOPS (mdc_stats); +static int mdc_dom_min_repsize_seq_show (struct seq_file *m,void *v) +{ +struct obd_device *dev = m->private; + +seq_printf (m,"%u\n" , dev->u.cli.cl_dom_min_inline_repsize); + +return 0 ; +} + +static ssize_t mdc_dom_min_repsize_seq_write (struct file *file, +const char __user *buffer, +size_t count,loff_t *off) +{ +struct obd_device *dev; +unsigned int val; +int rc; + + dev = ((struct seq_file *)file->private_data)->private; + rc =kstrtouint_from_user (buffer, count,0 , &val); +if (rc) +return rc; + +if (val >MDC_DOM_MAX_INLINE_REPSIZE ) +return -ERANGE ; + + dev->u.cli.cl_dom_min_inline_repsize = val; +return count; +} +LPROC_SEQ_FOPS (mdc_dom_min_repsize); +LPROC_SEQ_FOPS_RO_TYPE (mdc, connect_flags);LPROC_SEQ_FOPS_RO_TYPE (mdc, server_uuid);LPROC_SEQ_FOPS_RO_TYPE (mdc, timeouts);
@@ -489,6 +519,8 @@ static ssize_t mdc_stats_seq_write(struct file *file, .fops = &mdc_unstable_stats_fops }, { .name = "mdc_stats", .fops = &mdc_stats_fops }, + { .name = "mdc_dom_min_repsize", + .fops = &mdc_dom_min_repsize_fops }, { NULL } };
fs/lustre/mdc/mdc_internal.h +4 -0
@@ -159,4 +159,8 @@ int mdc_ldlm_blocking_ast(struct ldlm_lock *dlmlock, struct ldlm_lock_desc *new, void *data, int flag);int mdc_ldlm_glimpse_ast (struct ldlm_lock *dlmlock,void *data);int mdc_fill_lvb (struct ptlrpc_request *req,struct ost_lvb *lvb); + +#define MDC_DOM_DEF_INLINE_REPSIZE 8192 +#define MDC_DOM_MAX_INLINE_REPSIZE XATTR_SIZE_MAX +#endif
fs/lustre/mdc/mdc_locks.c +27 -1
@@ -254,8 +254,9 @@ static int mdc_save_lovea(struct ptlrpc_request *req,u32 lmmsize = op_data->op_data_size;LIST_HEAD (cancels);int count =0 ; -int mode; +enum ldlm_mode mode;int rc; +int repsize; it->it_create_mode = (it->it_create_mode & ~S_IFMT ) |S_IFREG ;
@@ -336,7 +337,32 @@ static int mdc_save_lovea(struct ptlrpc_request *req, obddev->u.cli.cl_max_mds_easize);req_capsule_set_size (&req->rq_pill, &RMF_ACL ,RCL_SERVER , acl_bufsize); +/** +* Inline buffer for possible data from Data-on-MDT files. +*/ +req_capsule_set_size (&req->rq_pill, &RMF_NIOBUF_INLINE ,RCL_SERVER , +sizeof (struct niobuf_remote ));ptlrpc_request_set_replen (req); + +/* Get real repbuf allocated size as rounded up power of 2 */ + repsize =size_roundup_power2 (req->rq_replen + +lustre_msg_early_size ()); + +/* Estimate free space for DoM files in repbuf */ + repsize -= req->rq_replen - obddev->u.cli.cl_max_mds_easize + +sizeof (struct lov_comp_md_v1 ) + +sizeof (struct lov_comp_md_entry_v1 ) + +lov_mds_md_size (0 ,LOV_MAGIC_V3 ); + +if (repsize < obddev->u.cli.cl_dom_min_inline_repsize) { + repsize = obddev->u.cli.cl_dom_min_inline_repsize - repsize; +req_capsule_set_size (&req->rq_pill, &RMF_NIOBUF_INLINE , +RCL_SERVER , +sizeof (struct niobuf_remote ) + repsize); +ptlrpc_request_set_replen (req); +CDEBUG (D_INFO ,"Increase repbuf by %d bytes, total: %d\n" , + repsize, req->rq_replen); + }return req; }
fs/lustre/mdc/mdc_request.c +2 -0
@@ -2551,6 +2551,8 @@ int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)if (rc) goto err_osc_cleanup; + obd->u.cli.cl_dom_min_inline_repsize =MDC_DOM_DEF_INLINE_REPSIZE ; +ns_register_cancel (obd->obd_namespace, mdc_cancel_weight); obd->obd_namespace->ns_lvbo = &inode_lvbo;
fs/lustre/ptlrpc/layout.c +9 -2
@@ -414,7 +414,8 @@ &RMF_MDT_MD , &RMF_ACL , &RMF_CAPA1 , - &RMF_CAPA2 + &RMF_CAPA2 , + &RMF_NIOBUF_INLINE, }; static const struct req_msg_field *ldlm_intent_getattr_client[] = {
@@ -1065,8 +1066,14 @@ struct req_msg_field RMF_NIOBUF_REMOTE = dump_rniobuf);EXPORT_SYMBOL (RMF_NIOBUF_REMOTE ); +struct req_msg_field RMF_NIOBUF_INLINE = +DEFINE_MSGF ("niobuf_inline" ,RMF_F_NO_SIZE_CHECK , +sizeof (struct niobuf_remote ), lustre_swab_niobuf_remote, + dump_rniobuf); +EXPORT_SYMBOL (RMF_NIOBUF_INLINE ); +struct req_msg_field RMF_RCS = -DEFINE_MSGF ("niobuf_remote" ,RMF_F_STRUCT_ARRAY ,sizeof (u32), +DEFINE_MSGF ("niobuf_rcs" ,RMF_F_STRUCT_ARRAY ,sizeof (u32), lustre_swab_generic_32s, dump_rcs);EXPORT_SYMBOL (RMF_RCS );
fs/lustre/ptlrpc/niobuf.c +5 -0
@@ -617,6 +617,11 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) request->rq_status = rc; goto cleanup_bulk; } +/* Use real allocated value in lm_repsize, +* so the server may use whole reply buffer +* without resends where it is needed. +*/ + request->rq_reqmsg->lm_repsize = request->rq_repbuf_len; }else { request->rq_repdata =NULL ; request->rq_repmsg =NULL ;
Signature · 1 line
1.8.3.1
PATCH 72/622 lustre: migrate: pack lmv ea in migrate rpc
In reply to James SimmonsFrom: Lai Siyao <[email protected]>
To support stripe directory migration, pack lmv_user_md in migrate RPC. Add arguments of 'mdt-count' and 'mdt-hash' for 'lfs migrate'.
Disable directory migration related tests temprorily, and we'll enable them later in the last patch of this set.
WC-bug-id: https://jira.whamcloud.com/browse/LU-4684
Lustre-commit: 470bdeec6ca5 ("LU-4684 migrate: pack lmv ea in migrate rpc")
Reviewed-on: https://review.whamcloud.com/31424
--- fs/lustre/llite/dir.c | 19 ++++++---- fs/lustre/llite/file.c | 67 +++++++++++++++++---------------- fs/lustre/llite/llite_internal.h | 4 +- fs/lustre/llite/llite_lib.c | 4 +- fs/lustre/mdc/mdc_lib.c | 21 +++++++---- fs/lustre/mdc/mdc_reint.c | 20 ++-------- fs/lustre/ptlrpc/layout.c | 3 +- include/uapi/linux/lustre/lustre_idl.h | 2 +- include/uapi/linux/lustre/lustre_user.h | 8 +++- 9 files changed, 77 insertions(+), 71 deletions(-)
fs/lustre/llite/dir.c +12 -7
@@ -1322,7 +1322,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto finish_req; } - lum_size =lmv_user_md_size (stripe_count,LMV_MAGIC_V1 ); + lum_size =lmv_user_md_size (stripe_count, +LMV_USER_MAGIC_SPECIFIC ); tmp =kzalloc (lum_size,GFP_NOFS );if (!tmp) { rc = -ENOMEM ;
@@ -1655,14 +1656,14 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)return rc; }case LL_IOC_MIGRATE : { -const char *filename; +struct lmv_user_md *lum; +char *filename;int namelen =0 ;int len;int rc; -int mdtidx; rc =obd_ioctl_getdata (&data, &len, (void __user *)arg); -if (rc <0 ) +if (rc)return rc; if (!data->ioc_inlbuf1 || !data->ioc_inlbuf2 ||
@@ -1674,17 +1675,21 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) filename = data->ioc_inlbuf1; namelen = data->ioc_inllen1;if (namelen <1 || namelen !=strlen (filename) +1 ) { +CDEBUG (D_INFO ,"IOC_MDC_LOOKUP missing filename\n" ); rc = -EINVAL ; goto migrate_free; } -if (data->ioc_inllen2 !=sizeof (mdtidx)) { + lum = (struct lmv_user_md *)data->ioc_inlbuf2; +if (lum->lum_magic !=LMV_USER_MAGIC && + lum->lum_magic !=LMV_USER_MAGIC_SPECIFIC ) { rc = -EINVAL ; +CERROR ("%s: wrong lum magic %x: rc = %d\n" , + filename, lum->lum_magic, rc); goto migrate_free; } - mdtidx = *(int *)data->ioc_inlbuf2; - rc =ll_migrate (inode, file, mdtidx, filename, namelen -1 ); + rc =ll_migrate (inode, file, lum, filename); migrate_free:kvfree (data);
fs/lustre/llite/file.c +34 -33
128 lines not on this page · raw message
fs/lustre/llite/llite_internal.h +2 -2
@@ -824,8 +824,8 @@ int ll_getattr(const struct path *path, struct kstat *stat,#define ll_set_acl NULL#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */ -int ll_migrate (struct inode *parent,struct file *file,int mdtidx, -const char *name,int namelen); +int ll_migrate (struct inode *parent,struct file *file, +struct lmv_user_md *lum,const char *name);int ll_get_fid_by_name (struct inode *parent,const char *name,int namelen,struct lu_fid *fid,struct inode **inode);int ll_inode_permission (struct inode *inode,int mask);
fs/lustre/llite/llite_lib.c +3 -1
@@ -209,7 +209,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)OBD_CONNECT_GRANT_PARAM |OBD_CONNECT_SHORTIO |OBD_CONNECT_FLAGS2 ; - data->ocd_connect_flags2 =OBD_CONNECT2_FLR |OBD_CONNECT2_LOCK_CONVERT ; + data->ocd_connect_flags2 =OBD_CONNECT2_FLR | +OBD_CONNECT2_LOCK_CONVERT | +OBD_CONNECT2_DIR_MIGRATE ;if (sbi->ll_flags &LL_SBI_LRU_RESIZE ) data->ocd_connect_flags |=OBD_CONNECT_LRU_RESIZE ;
fs/lustre/mdc/mdc_lib.c +14 -7
@@ -443,7 +443,7 @@ static void mdc_close_intent_pack(struct ptlrpc_request *req,struct close_data *data;struct ldlm_lock *lock; -if (!(bias & (MDS_CLOSE_INTENT |MDS_RENAME_MIGRATE ))) +if (!(bias & (MDS_CLOSE_INTENT |MDS_CLOSE_MIGRATE )))return ; data =req_capsule_client_get (&req->rq_pill, &RMF_CLOSE_DATA );
@@ -507,13 +507,20 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,if (new)mdc_pack_name (req, &RMF_SYMTGT , new, newlen); -if (op_data->op_cli_flags &CLI_MIGRATE && - op_data->op_bias &MDS_RENAME_MIGRATE ) { -struct mdt_ioepoch *epoch; +if (op_data->op_cli_flags &CLI_MIGRATE ) { +char *tmp; -mdc_close_intent_pack (req, op_data); - epoch =req_capsule_client_get (&req->rq_pill, &RMF_MDT_EPOCH ); -mdc_ioepoch_pack (epoch, op_data); +if (op_data->op_bias &MDS_CLOSE_MIGRATE ) { +struct mdt_ioepoch *epoch; + +mdc_close_intent_pack (req, op_data); + epoch =req_capsule_client_get (&req->rq_pill, + &RMF_MDT_EPOCH ); +mdc_ioepoch_pack (epoch, op_data); + } + + tmp =req_capsule_client_get (&req->rq_pill, &RMF_EADATA ); +memcpy (tmp, op_data->op_data, op_data->op_data_size); } }
fs/lustre/mdc/mdc_reint.c +3 -17
@@ -390,6 +390,9 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,req_capsule_set_size (&req->rq_pill, &RMF_NAME ,RCL_CLIENT , oldlen +1 );req_capsule_set_size (&req->rq_pill, &RMF_SYMTGT ,RCL_CLIENT , newlen +1 ); +if (op_data->op_cli_flags &CLI_MIGRATE ) +req_capsule_set_size (&req->rq_pill, &RMF_EADATA ,RCL_CLIENT , + op_data->op_data_size); rc =mdc_prep_elc_req (exp, req,MDS_REINT , &cancels, count);if (rc) {
@@ -397,23 +400,6 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,return rc; } -if (op_data->op_cli_flags &CLI_MIGRATE && op_data->op_data) { -struct md_open_data *mod = op_data->op_data; - -LASSERTF (mod->mod_open_req && - mod->mod_open_req->rq_type !=LI_POISON , -"POISONED open %p!\n" , mod->mod_open_req); - -DEBUG_REQ (D_HA , mod->mod_open_req,"matched open" ); -/* -* We no longer want to preserve this open for replay even -* though the open was committed. b=3632, b=3633 -*/ -spin_lock (&mod->mod_open_req->rq_lock); - mod->mod_open_req->rq_replay =0 ; -spin_unlock (&mod->mod_open_req->rq_lock); - } -if (exp_connect_cancelset (exp) && req)ldlm_cli_cancel_list (&cancels, count, req,0 );
fs/lustre/ptlrpc/layout.c +2 -1
@@ -263,7 +263,8 @@ &RMF_SYMTGT , &RMF_DLM_REQ , &RMF_MDT_EPOCH , - &RMF_CLOSE_DATA + &RMF_CLOSE_DATA , + &RMF_EADATA }; static const struct req_msg_field *mds_last_unlink_server[] = {
include/uapi/linux/lustre/lustre_idl.h +1 -1
@@ -1693,7 +1693,7 @@ enum mds_op_bias {MDS_CREATE_VOLATILE =1 <<10 ,MDS_OWNEROVERRIDE =1 <<11 ,MDS_HSM_RELEASE =1 <<12 , -MDS_RENAME_MIGRATE =1 <<13 , +MDS_CLOSE_MIGRATE =1 <<13 ,MDS_CLOSE_LAYOUT_SWAP =1 <<14 ,MDS_CLOSE_LAYOUT_MERGE =1 <<15 , MDS_CLOSE_RESYNC_DONE = 1 << 16,
include/uapi/linux/lustre/lustre_user.h +6 -2
@@ -632,8 +632,12 @@ struct lmv_user_md_v1 {static inline int lmv_user_md_size (int stripes,int lmm_magic) { -return sizeof (struct lmv_user_md ) + - stripes *sizeof (struct lmv_user_mds_data ); +int size =sizeof (struct lmv_user_md ); + +if (lmm_magic ==LMV_USER_MAGIC_SPECIFIC ) + size += stripes *sizeof (struct lmv_user_mds_data ); + +return size; }struct ll_recreate_obj {
Signature · 1 line
1.8.3.1
PATCH 73/622 lustre: hsm: add OBD_CONNECT2_ARCHIVE_ID_ARRAY to pass archive_id lists in array
In reply to James SimmonsFrom: Teddy Zheng <[email protected]>
Clients registed to MDS with OBD_CONNECT2_ARCHIVE_ID_ARRAY will use array to pass ARCHIVED IDs. While clients without it still use bitmap. This flag allows old clients connect to new MDSs.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10114
Lustre-commit: 1c7e7d1243f7 ("LU-10114 hsm: add OBD_CONNECT2_ARCHIVE_ID_ARRAY to pass archive_id lists in array")
Reviewed-on: https://review.whamcloud.com/32806
--- fs/lustre/obdclass/lprocfs_status.c | 1 + fs/lustre/ptlrpc/wiretest.c | 2 ++ include/uapi/linux/lustre/lustre_idl.h | 1 + 3 files changed, 4 insertions(+)
fs/lustre/obdclass/lprocfs_status.c +1 -0
@@ -119,6 +119,7 @@"flr" ,/* 0x20 */ "wbc" ,/* 0x40 */ "lock_convert" ,/* 0x80 */ +"archive_id_array" ,/* 0x100 */ NULL };
fs/lustre/ptlrpc/wiretest.c +2 -0
@@ -1141,6 +1141,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_WBC_INTENTS);LASSERTF (OBD_CONNECT2_LOCK_CONVERT ==0x80ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_LOCK_CONVERT ); +LASSERTF (OBD_CONNECT2_ARCHIVE_ID_ARRAY ==0x100ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_ARCHIVE_ID_ARRAY );LASSERTF (OBD_CKSUM_CRC32 ==0x00000001UL ,"found 0x%.8xUL\n" , (unsigned int )OBD_CKSUM_CRC32 ); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +1 -0
@@ -800,6 +800,7 @@ struct ptlrpc_body_v2 {* locks */ #define OBD_CONNECT2_LOCK_CONVERT 0x80ULL/* IBITS lock convert support */ +#define OBD_CONNECT2_ARCHIVE_ID_ARRAY 0x100ULL/* store HSM archive_id in array */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same
Signature · 1 line
1.8.3.1
PATCH 74/622 lustre: llite: handle zero length xattr values correctly
In reply to James SimmonsFrom: "John L. Hammond" <[email protected]>
In mdt_getxattr(), set OBD_MD_FLXATTR in mbo_valid of the reply's MDT body so that the client can distinguish between nonexistent extended attributes and zero length values. In ll_xattr_list() and ll_getxattr_common() test for OBD_MD_FLXATTR and return 0 rather than -ENODATA in the appropriate cases. Add sanity test_102t() to test that zero length values are handled correctly.
Lustre-commit: 1e4164a1254d ("LU-11109 mdt: handle zero length xattr values correctly")
Reviewed-on: https://review.whamcloud.com/32755
--- fs/lustre/llite/xattr.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
fs/lustre/llite/xattr.c +21 -1
@@ -363,6 +363,11 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer,/* only detect the xattr size */ if (size ==0 ) { +/* LU-11109: Older MDTs do not distinguish +* between nonexistent xattrs and zero length +* values in this case. Newer MDTs will return +* -ENODATA or set OBD_MD_FLXATTR. +*/ rc = body->mbo_eadatasize; goto out; }
@@ -375,7 +380,22 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer, }if (body->mbo_eadatasize ==0 ) { - rc = -ENODATA ; +/* LU-11109: Newer MDTs set OBD_MD_FLXATTR on +* success so that we can distinguish between +* zero length value and nonexistent xattr. +* +* If OBD_MD_FLXATTR is not set then we keep +* the old behavior and return -ENODATA for +* getxattr() when mbo_eadatasize is 0. But +* -ENODATA only makes sense for getxattr() +* and not for listxattr(). +*/ +if (body->mbo_valid &OBD_MD_FLXATTR ) + rc =0 ; +else if (valid ==OBD_MD_FLXATTR ) + rc = -ENODATA ; +else + rc =0 ; goto out; }
Signature · 1 line
1.8.3.1
PATCH 75/622 lnet: refactor lnet_select_pathway()
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
lnet_select_pathway() is a complex monolithic function which handles many send cases. Broke down lnet_select_pathway() to multiple functions. Each function handles a different send case. This will make it easier to add the handling of the different health cases in future patches.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 4e48761a5719 ("LU-9120 lnet: refactor lnet_select_pathway()")
Reviewed-on: https://review.whamcloud.com/32760
--- include/linux/lnet/lib-lnet.h | 13 + net/lnet/lnet/lib-move.c | 1398 ++++++++++++++++++++++++++--------------- 2 files changed, 911 insertions(+), 500 deletions(-)
include/linux/lnet/lib-lnet.h +13 -0
@@ -827,6 +827,19 @@ int lnet_get_peer_ni_info(u32 peer_index, u64 *nid,return false; } +static inline struct lnet_peer_net * +lnet_find_peer_net_locked (struct lnet_peer *peer,u32 net_id) +{ +struct lnet_peer_net *peer_net; + +list_for_each_entry (peer_net, &peer->lp_peer_nets, lpn_peer_nets) { +if (peer_net->lpn_net_id == net_id) +return peer_net; + } + +return NULL ; +} +static inline void lnet_peer_set_alive (struct lnet_peer_ni *lp) {
net/lnet/lnet/lib-move.c +898 -500
1,515 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 76/622 lnet: add health value per ni
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add a health value per local network interface. The health value reflects the health of the NI. It is initialized to 1000. 1000 is chosen to be able to granularly decrement the health value on error.
If the NI is absolutely not healthy that will be indicated by an LND event, which will flag that the NI is down and should never be used.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: d54afb86116c ("LU-9120 lnet: add health value per ni")
Reviewed-on: https://review.whamcloud.com/32761
--- include/linux/lnet/lib-types.h | 15 +++++++++++++++ net/lnet/lnet/api-ni.c | 1 + net/lnet/lnet/lib-move.c | 17 +++++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-)
include/linux/lnet/lib-types.h +15 -0
@@ -52,6 +52,12 @@#define LNET_MAX_IOV (LNET_MAX_PAYLOAD >> PAGE_SHIFT) +/* +* This is the maximum health value. +* All local and peer NIs created have their health default to this value. +*/ +#define LNET_MAX_HEALTH_VALUE 1000 +/* forward refs */ struct lnet_libmd ;
@@ -388,6 +394,15 @@ struct lnet_ni {u32 ni_seq;/* +* health value +* initialized to LNET_MAX_HEALTH_VALUE +* Value is decremented every time we fail to send a message over +* this NI because of a NI specific failure. +* Value is incremented if we successfully send a message. +*/ +atomic_t ni_healthv; + +/* * equivalent interfaces to use * This is an array because socklnd bonding can still be configured */
net/lnet/lnet/api-ni.c +1 -0
@@ -1817,6 +1817,7 @@ static void lnet_push_target_fini(void)atomic_set (&ni->ni_tx_credits,lnet_ni_tq_credits (ni) * ni->ni_ncpts); +atomic_set (&ni->ni_healthv,LNET_MAX_HEALTH_VALUE ); CDEBUG(D_LNI, "Added LNI %s [%d/%d/%d/%d]\n", libcfs_nid2str(ni->ni_nid),
net/lnet/lnet/lib-move.c +11 -6
@@ -1276,6 +1276,7 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,struct lnet_ni *ni =NULL ;unsigned int shortest_distance;int best_credits; +int best_healthv;/* If there is no peer_ni that we can send to on this network, * then there is no point in looking for a new best_ni here.
@@ -1286,20 +1287,21 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,if (!best_ni) { shortest_distance =UINT_MAX ; best_credits =INT_MIN ; + best_healthv =0 ; }else { shortest_distance =cfs_cpt_distance (lnet_cpt_table (), md_cpt, best_ni->ni_dev_cpt); best_credits =atomic_read (&best_ni->ni_tx_credits); + best_healthv =atomic_read (&best_ni->ni_healthv); }while ((ni =lnet_get_next_ni_locked (local_net, ni))) {unsigned int distance;int ni_credits; - -if (!lnet_is_ni_healthy_locked (ni)) -continue ; +int ni_healthv; ni_credits =atomic_read (&ni->ni_tx_credits); + ni_healthv =atomic_read (&ni->ni_healthv);/* * calculate the distance from the CPT on which
@@ -1325,21 +1327,24 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, distance = lnet_numa_range;/* -* Select on shorter distance, then available +* Select on health, shorter distance, available * credits, then round-robin. */ -if (distance > shortest_distance) { +if (ni_healthv < best_healthv) { +continue ; + }else if (distance > shortest_distance) {continue ; }else if (distance < shortest_distance) { shortest_distance = distance; }else if (ni_credits < best_credits) {continue ; }else if (ni_credits == best_credits) { -if (best_ni && (best_ni)->ni_seq <= ni->ni_seq) +if (best_ni && best_ni->ni_seq <= ni->ni_seq)continue ; } best_ni = ni; best_credits = ni_credits; + best_healthv = ni_healthv; } CDEBUG(D_NET, "selected best_ni %s\n",
Signature · 1 line
1.8.3.1
PATCH 77/622 lnet: add lnet_health_sensitivity
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add lnet_health_senstivity value. This value determines the amount the NI health value is decremented by. The value defaults to 0, which turns off the health feature by default. The user needs to explicitly turn on this feature. The assumption is that many sites will only have one interface in their nodes. In this case the health feature will not increase the resiliency of their system.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 63cf744d0fdf ("LU-9120 lnet: add lnet_health_sensitivity")
Reviewed-on: https://review.whamcloud.com/32762
--- include/linux/lnet/lib-lnet.h | 1 + net/lnet/lnet/api-ni.c | 52 +++++++++++++++++++++++++++++++++++++++++++ net/lnet/lnet/lib-move.c | 11 ++++++++- 3 files changed, 63 insertions(+), 1 deletion(-)
include/linux/lnet/lib-lnet.h +1 -0
@@ -479,6 +479,7 @@ struct lnet_ni *extern unsigned int lnet_transaction_timeout;extern unsigned int lnet_numa_range; +extern unsigned int lnet_health_sensitivity;extern unsigned int lnet_peer_discovery_disabled;extern int portal_rotor;
net/lnet/lnet/api-ni.c +52 -0
64 lines not on this page · raw message
net/lnet/lnet/lib-move.c +10 -1
@@ -1332,6 +1332,16 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,*/ if (ni_healthv < best_healthv) {continue ; + }else if (ni_healthv > best_healthv) { + best_healthv = ni_healthv; +/* If we're going to prefer this ni because it's +* the healthiest, then we should set the +* shortest_distance in the algorithm in case +* there are multiple NIs with the same health but +* different distances. +*/ +if (distance < shortest_distance) + shortest_distance = distance; }else if (distance > shortest_distance) {continue ; }else if (distance < shortest_distance) {
@@ -1344,7 +1354,6 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, } best_ni = ni; best_credits = ni_credits; - best_healthv = ni_healthv; } CDEBUG(D_NET, "selected best_ni %s\n",
Signature · 1 line
1.8.3.1
PATCH 78/622 lnet: add monitor thread
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Refactored the router checker thread to be the monitor thread. The monitor thread will check router aliveness, expires messages on the active list, recover local and remote NIs and resend messages.
In this patch it only checks router aliveness.
A deadline on the message is also added to keep track of when this message should expire.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: b01e6fce1c98 ("LU-9120 lnet: add monitor thread")
Reviewed-on: https://review.whamcloud.com/32763
--- include/linux/lnet/lib-lnet.h | 11 ++- include/linux/lnet/lib-types.h | 27 +++---- net/lnet/lnet/api-ni.c | 12 ++-- net/lnet/lnet/lib-move.c | 98 ++++++++++++++++++++++++++ net/lnet/lnet/lib-msg.c | 9 ++- net/lnet/lnet/router.c | 156 +++++++++++++---------------------------- 6 files changed, 185 insertions(+), 128 deletions(-)
include/linux/lnet/lib-lnet.h +9 -2
@@ -714,8 +714,15 @@ int lnet_sock_connect(struct socket **sockp, int *fatal,int lnet_peers_start_down (void );int lnet_peer_buffer_credits (struct lnet_net *net); -int lnet_router_checker_start (void ); -void lnet_router_checker_stop (void ); +int lnet_monitor_thr_start (void ); +void lnet_monitor_thr_stop (void ); + +bool lnet_router_checker_active (void ); +void lnet_check_routers (void ); +int lnet_router_pre_mt_start (void ); +void lnet_router_post_mt_start (void ); +void lnet_prune_rc_data (int wait_unlink); +void lnet_router_cleanup (void );void lnet_router_ni_update_locked (struct lnet_peer_ni *gw,u32 net);void lnet_swap_pinginfo (struct lnet_ping_buffer *pbuf);
include/linux/lnet/lib-types.h +15 -12
@@ -79,6 +79,12 @@ struct lnet_msg {lnet_nid_t msg_src_nid_param;lnet_nid_t msg_rtr_nid_param; +/* +* Deadline for the message after which it will be finalized if it +* has not completed. +*/ +ktime_t msg_deadline; +/* committed for sending */ unsigned int msg_tx_committed:1;/* CPT # this message committed for sending */
@@ -905,9 +911,9 @@ struct lnet_msg_container {/* Router Checker states */ enum lnet_rc_state { -LNET_RC_STATE_SHUTDOWN ,/* not started */ -LNET_RC_STATE_RUNNING ,/* started up OK */ -LNET_RC_STATE_STOPPING ,/* telling thread to stop */ +LNET_MT_STATE_SHUTDOWN ,/* not started */ +LNET_MT_STATE_RUNNING ,/* started up OK */ +LNET_MT_STATE_STOPPING ,/* telling thread to stop */ };/* LNet states */
@@ -1014,8 +1020,8 @@ struct lnet {/* discovery startup/shutdown state */ int ln_dc_state; -/* router checker startup/shutdown state */ -enum lnet_rc_state ln_rc_state; +/* monitor thread startup/shutdown state */ +enum lnet_rc_state ln_mt_state;/* router checker's event queue */ struct lnet_handle_eq ln_rc_eqh;/* rcd still pending on net */
@@ -1023,7 +1029,7 @@ struct lnet {/* rcd ready for free */ struct list_head ln_rcd_zombie;/* serialise startup/shutdown */ -struct completion ln_rc_signal; +struct completion ln_mt_signal;struct mutex ln_api_mutex;struct mutex ln_lnd_mutex;
@@ -1053,13 +1059,10 @@ struct lnet {*/ bool ln_nis_from_mod_params; -/* -* waitq for router checker. As long as there are no routes in -* the list, the router checker will sleep on this queue. when -* routes are added the thread will wake up +/* waitq for the monitor thread. The monitor thread takes care of +* checking routes, timedout messages and resending messages. */ - wait_queue_head_t ln_rc_waitq; - + wait_queue_head_t ln_mt_waitq; };#endif
net/lnet/lnet/api-ni.c +6 -6
@@ -309,7 +309,7 @@ static int lnet_discover(struct lnet_process_id id, u32 force,spin_lock_init (&the_lnet.ln_eq_wait_lock);spin_lock_init (&the_lnet.ln_msg_resend_lock);init_waitqueue_head (&the_lnet.ln_eq_waitq); -init_waitqueue_head (&the_lnet.ln_rc_waitq); +init_waitqueue_head (&the_lnet.ln_mt_waitq);mutex_init (&the_lnet.ln_lnd_mutex); }
@@ -2281,13 +2281,13 @@ void lnet_lib_exit(void)lnet_ping_target_update (pbuf, ping_mdh); - rc =lnet_router_checker_start (); + rc =lnet_monitor_thr_start ();if (rc) goto err_stop_ping; rc =lnet_push_target_init ();if (rc !=0 ) - goto err_stop_router_checker; + goto err_stop_monitor_thr; rc =lnet_peer_discovery_start ();if (rc !=0 )
@@ -2302,8 +2302,8 @@ void lnet_lib_exit(void) err_destroy_push_target:lnet_push_target_fini (); -err_stop_router_checker: -lnet_router_checker_stop (); +err_stop_monitor_thr: +lnet_monitor_thr_stop (); err_stop_ping:lnet_ping_target_fini (); err_acceptor_stop:
@@ -2353,7 +2353,7 @@ void lnet_lib_exit(void)lnet_router_debugfs_fini ();lnet_peer_discovery_stop ();lnet_push_target_fini (); -lnet_router_checker_stop (); +lnet_monitor_thr_stop ();lnet_ping_target_fini ();/* Teardown fns that use my own API functions BEFORE here */
net/lnet/lnet/lib-move.c +98 -0
116 lines not on this page · raw message
net/lnet/lnet/lib-msg.c +7 -2
@@ -141,13 +141,17 @@ {struct lnet_msg_container *container = the_lnet.ln_msg_containers[cpt];struct lnet_counters *counters = the_lnet.ln_counters[cpt]; +s64 timeout_ns; + +/* set the message deadline */ + timeout_ns = lnet_transaction_timeout *NSEC_PER_SEC ; + msg->msg_deadline =ktime_add_ns (ktime_get (), timeout_ns);/* routed message can be committed for both receiving and sending */ LASSERT (!msg->msg_tx_committed);if (msg->msg_sending) {LASSERT (!msg->msg_receiving); - msg->msg_tx_cpt = cpt; msg->msg_tx_committed =1 ;if (msg->msg_rx_committed) {/* routed message REPLY */
@@ -161,8 +165,9 @@ }LASSERT (!msg->msg_onactivelist); + msg->msg_onactivelist =1 ; -list_add (&msg->msg_activelist, &container->msc_active); +list_add_tail (&msg->msg_activelist, &container->msc_active); counters->msgs_alloc++;if (counters->msgs_alloc > counters->msgs_max)
net/lnet/lnet/router.c +50 -106
257 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 79/622 lnet: handle local ni failure
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Added an enumerated type listing the different errors which the LND can propagate up to LNet for further handling.
All local timeout errors will trigger a resend if the system is configured for resends. Remote errors will not trigger a resend to avoid creating duplicate message scenario on the receiving end. If a transmit error is encountered where we're sure the message wasn't received by the remote end we will attempt a resend.
LNet level logic to handle local NI failure. When the LND finalizes a message lnet_finalize() will check if the message completed successfully, if so it increments the healthv of the local NI, but not beyond the max, and if it failed then it'll decrement the healthv but not below 0 and put the message on the resend queue.
On local NI failure the local NI is placed on a recovery queue.
The monitor thread will wake up and resend all the messages pending. The selection algorithm will properly select the local and remote NIs based on the new healthv.
The monitor thread will ping each NI on the local recovery queue. On reply it will check if the NIs healthv is back to maximum, if it is then it will remove it from the recovery queue, otherwise it'll keep it there until it's fully recovered.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 70616605dd44 ("LU-9120 lnet: handle local ni failure")
Reviewed-on: https://review.whamcloud.com/32764
--- include/linux/lnet/api.h | 3 +- include/linux/lnet/lib-lnet.h | 3 + include/linux/lnet/lib-types.h | 54 +++-- net/lnet/lnet/api-ni.c | 30 ++- net/lnet/lnet/config.c | 3 +- net/lnet/lnet/lib-move.c | 516 +++++++++++++++++++++++++++++++++++++++-- net/lnet/lnet/lib-msg.c | 281 +++++++++++++++++++++- net/lnet/lnet/peer.c | 57 ++--- net/lnet/lnet/router.c | 2 +- net/lnet/selftest/rpc.c | 2 +- 10 files changed, 862 insertions(+), 89 deletions(-)
include/linux/lnet/api.h +2 -1
@@ -195,7 +195,8 @@ int LNetGet(lnet_nid_t self,struct lnet_process_id target_in, unsigned int portal_in, u64 match_bits_in, - unsigned int offset_in); + unsigned int offset_in, + bool recovery);/** @} lnet_data */ /** \defgroup lnet_misc Miscellaneous operations.
include/linux/lnet/lib-lnet.h +3 -0
@@ -536,6 +536,8 @@ void lnet_prep_send(struct lnet_msg *msg, int type, struct lnet_process_id target, unsigned int offset, unsigned int len);int lnet_send (lnet_nid_t nid,struct lnet_msg *msg,lnet_nid_t rtr_nid); +int lnet_send_ping (lnet_nid_t dest_nid,struct lnet_handle_md *mdh,int nnis, +void *user_ptr,struct lnet_handle_eq eqh,bool recovery);void lnet_return_tx_credits_locked (struct lnet_msg *msg);void lnet_return_rx_credits_locked (struct lnet_msg *msg);void lnet_schedule_blocked_locked (struct lnet_rtrbufpool *rbp);
@@ -623,6 +625,7 @@ void lnet_drop_message(struct lnet_ni *ni, int cpt, void *private,void lnet_msg_containers_destroy (void );int lnet_msg_containers_create (void ); +char *lnet_health_error2str (enum lnet_msg_hstatus hstatus);char *lnet_msgtyp2str (int type);void lnet_print_hdr (struct lnet_hdr *hdr);int lnet_fail_nid (lnet_nid_t nid,unsigned int threshold);
include/linux/lnet/lib-types.h +41 -13
90 lines not on this page · raw message
net/lnet/lnet/api-ni.c +24 -6
@@ -831,6 +831,7 @@ struct lnet_libhandle *INIT_LIST_HEAD (&the_lnet.ln_dc_request);INIT_LIST_HEAD (&the_lnet.ln_dc_working);INIT_LIST_HEAD (&the_lnet.ln_dc_expired); +INIT_LIST_HEAD (&the_lnet.ln_mt_localNIRecovq);init_waitqueue_head (&the_lnet.ln_dc_waitq); rc =lnet_descriptor_setup ();
@@ -1072,8 +1073,7 @@ struct lnet_net *bool lnet_is_ni_healthy_locked (struct lnet_ni *ni) { -if (ni->ni_state ==LNET_NI_STATE_ACTIVE || - ni->ni_state ==LNET_NI_STATE_DEGRADED ) +if (ni->ni_state &LNET_NI_STATE_ACTIVE )return true;return false;
@@ -1650,7 +1650,7 @@ static void lnet_push_target_fini(void)list_del_init (&ni->ni_netlist);/* the ni should be in deleting state. If it's not it's * a bug */ -LASSERT (ni->ni_state ==LNET_NI_STATE_DELETING ); +LASSERT (ni->ni_state &LNET_NI_STATE_DELETING );cfs_percpt_for_each (ref, j, ni->ni_refs) {if (!*ref)continue ;
@@ -1697,7 +1697,10 @@ static void lnet_push_target_fini(void)struct lnet_net *net = ni->ni_net;lnet_net_lock (LNET_LOCK_EX ); - ni->ni_state =LNET_NI_STATE_DELETING ; +lnet_ni_lock (ni); + ni->ni_state |=LNET_NI_STATE_DELETING ; + ni->ni_state &= ~LNET_NI_STATE_ACTIVE ; +lnet_ni_unlock (ni);lnet_ni_unlink_locked (ni);lnet_incr_dlc_seq ();lnet_net_unlock (LNET_LOCK_EX );
@@ -1789,6 +1792,7 @@ static void lnet_push_target_fini(void)list_for_each_entry_safe (msg, tmp, &resend, msg_list) {list_del_init (&msg->msg_list); + msg->msg_no_resend = true;lnet_finalize (msg, -ECANCELED ); }
@@ -1827,7 +1831,10 @@ static void lnet_push_target_fini(void) goto failed0; } - ni->ni_state =LNET_NI_STATE_ACTIVE ; +lnet_ni_lock (ni); + ni->ni_state |=LNET_NI_STATE_ACTIVE ; + ni->ni_state &= ~LNET_NI_STATE_INIT ; +lnet_ni_unlock (ni);/* We keep a reference on the loopback net through the loopback NI */ if (net->net_lnd->lnd_type ==LOLND ) {
@@ -2554,11 +2561,17 @@ struct lnet_ni *struct lnet_ni *ni;struct lnet_net *net = mynet; +/* It is possible that the net has been cleaned out while there is +* a message being sent. This function accessed the net without +* checking if the list is empty +*/ if (!prev) {if (!net) net =list_first_entry (&the_lnet.ln_nets, struct lnet_net, net_list); +if (list_empty (&net->net_ni_list)) +return NULL ; ni = list_first_entry(&net->net_ni_list, struct lnet_ni, ni_netlist);
@@ -2580,6 +2593,8 @@ struct lnet_ni */* get the next net */ net = list_first_entry(&prev->ni_net->net_list, struct lnet_net, net_list); +if (list_empty (&net->net_ni_list)) +return NULL ;/* get the ni on it */ ni = list_first_entry(&net->net_ni_list, struct lnet_ni, ni_netlist);
@@ -2587,6 +2602,9 @@ struct lnet_ni *return ni; } +if (list_empty (&prev->ni_netlist)) +return NULL ; +/* there are more nis left */ ni = list_first_entry(&prev->ni_netlist, struct lnet_ni, ni_netlist);
@@ -3571,7 +3589,7 @@ static int lnet_ping(struct lnet_process_id id, signed long timeout, rc =LNetGet (LNET_NID_ANY , mdh, id,LNET_RESERVED_PORTAL , -LNET_PROTO_PING_MATCHBITS ,0 ); +LNET_PROTO_PING_MATCHBITS ,0 , false);if (rc) {/* Don't CERROR; this could be deliberate! */ rc2 =LNetMDUnlink (mdh);
net/lnet/lnet/config.c +2 -1
@@ -442,6 +442,7 @@ struct lnet_net *spin_lock_init (&ni->ni_lock);INIT_LIST_HEAD (&ni->ni_netlist); +INIT_LIST_HEAD (&ni->ni_recovery); ni->ni_refs =cfs_percpt_alloc (lnet_cpt_table (),sizeof (*ni->ni_refs[0 ]));if (!ni->ni_refs)
@@ -466,7 +467,7 @@ struct lnet_net * ni->ni_net_ns =NULL ; ni->ni_last_alive =ktime_get_real_seconds (); - ni->ni_state =LNET_NI_STATE_INIT ; + ni->ni_state |=LNET_NI_STATE_INIT ;list_add_tail (&ni->ni_netlist, &net->net_ni_added);/*
net/lnet/lnet/lib-move.c +498 -18
646 lines not on this page · raw message
net/lnet/lnet/lib-msg.c +272 -9
319 lines not on this page · raw message
net/lnet/lnet/peer.c +18 -39
81 lines not on this page · raw message
net/lnet/lnet/router.c +1 -1
@@ -1079,7 +1079,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)lnet_net_unlock (rtr->lpni_cpt); rc =LNetGet (LNET_NID_ANY , mdh, id,LNET_RESERVED_PORTAL , -LNET_PROTO_PING_MATCHBITS ,0 ); +LNET_PROTO_PING_MATCHBITS ,0 , false);lnet_net_lock (rtr->lpni_cpt);if (rc)
net/lnet/selftest/rpc.c +1 -1
@@ -425,7 +425,7 @@ struct srpc_bulk * }else {LASSERT (options &LNET_MD_OP_GET ); - rc =LNetGet (self, *mdh, peer, portal, matchbits,0 ); + rc =LNetGet (self, *mdh, peer, portal, matchbits,0 , false); }if (rc) {
Signature · 1 line
1.8.3.1
PATCH 80/622 lnet: handle o2iblnd tx failure
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Monitor the different types of failures that might occur on the transmit and flag the type of failure to be propagated to LNet which will handle either by attempting a resend or simply finalizing the message and propagating a failure to the ULP.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 8cf835e425d8 ("LU-9120 lnet: handle o2iblnd tx failure")
Reviewed-on: https://review.whamcloud.com/32765
--- net/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- net/lnet/klnds/o2iblnd/o2iblnd.h | 4 ++- net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 59 ++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 10 deletions(-)
net/lnet/klnds/o2iblnd/o2iblnd.c +1 -1
@@ -519,7 +519,7 @@ static int kiblnd_del_peer(struct lnet_ni *ni, lnet_nid_t nid)write_unlock_irqrestore (&kiblnd_data.kib_global_lock, flags); -kiblnd_txlist_done (&zombies, -EIO ); +kiblnd_txlist_done (&zombies, -EIO ,LNET_MSG_STATUS_LOCAL_ERROR );return rc; }
net/lnet/klnds/o2iblnd/o2iblnd.h +3 -1
@@ -515,6 +515,7 @@ struct kib_tx { /* transmit message */short tx_queued;/* queued for sending */ short tx_waiting;/* waiting for peer_ni */ int tx_status;/* LNET completion status */ +enum lnet_msg_hstatus tx_hstatus;/* health status of the transmit */ ktime_t tx_deadline;/* completion deadline */ u64 tx_cookie;/* completion cookie */ struct lnet_msg *tx_lntmsg[2 ];/* lnet msgs to finalize on completion */
@@ -1027,7 +1028,8 @@ struct kib_conn *kiblnd_create_conn(struct kib_peer_ni *peer_ni,void kiblnd_close_conn_locked (struct kib_conn *conn,int error);void kiblnd_launch_tx (struct lnet_ni *ni,struct kib_tx *tx,lnet_nid_t nid); -void kiblnd_txlist_done (struct list_head *txlist,int status); +void kiblnd_txlist_done (struct list_head *txlist,int status, +enum lnet_msg_hstatus hstatus);void kiblnd_qp_event (struct ib_event *event,void *arg);void kiblnd_cq_event (struct ib_event *event,void *arg);
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +51 -8
169 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 81/622 lnet: handle socklnd tx failure
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Update the socklnd to propagate the health status up to LNet for handling.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 25c1cb2c4d6f ("LU-9120 lnet: handle socklnd tx failure")
Reviewed-on: https://review.whamcloud.com/32766
--- net/lnet/klnds/socklnd/socklnd.h | 1 + net/lnet/klnds/socklnd/socklnd_cb.c | 49 ++++++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-)
net/lnet/klnds/socklnd/socklnd.h +1 -0
@@ -289,6 +289,7 @@ struct ksock_tx { /* transmit packet */time64_t tx_deadline;/* when (in secs) tx times out */ struct ksock_msg tx_msg;/* socklnd message buffer */ int tx_desc_size;/* size of this descriptor */ +enum lnet_msg_hstatus tx_hstatus;/* health status of tx */ union { struct { struct kvec iov; /* virt hdr */
net/lnet/klnds/socklnd/socklnd_cb.c +46 -3
113 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 82/622 lnet: handle remote errors in LNet
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add health value in the peer NI structure. Decrement the value whenever there is an error sending to the peer. Modify the selection algorithm to look at the peer NI health value when selecting the best peer NI to send to.
Put the peer NI on the recovery queue whenever there is an error sending to it. Attempt only to resend on REMOTE DROPPED since we're sure the message was never received by the peer. For other errors finalize the message.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 76fad19c2dea ("LU-9120 lnet: handle remote errors in LNet")
Reviewed-on: https://review.whamcloud.com/32767
--- include/linux/lnet/lib-lnet.h | 6 + include/linux/lnet/lib-types.h | 12 ++ net/lnet/lnet/api-ni.c | 1 + net/lnet/lnet/lib-move.c | 311 +++++++++++++++++++++++++++++++++++------ net/lnet/lnet/lib-msg.c | 87 ++++++++++-- net/lnet/lnet/peer.c | 9 ++ 6 files changed, 368 insertions(+), 58 deletions(-)
include/linux/lnet/lib-lnet.h +6 -0
@@ -894,6 +894,12 @@ int lnet_get_peer_ni_info(u32 peer_index, u64 *nid,return false; } +static inline void +lnet_inc_healthv (atomic_t *healthv) +{ +atomic_add_unless (healthv,1 ,LNET_MAX_HEALTH_VALUE ); +} +void lnet_incr_stats (struct lnet_element_stats *stats,enum lnet_msg_type msg_type,enum lnet_stats_type stats_type);
include/linux/lnet/lib-types.h +12 -0
@@ -478,6 +478,8 @@ struct lnet_peer_ni {struct list_head lpni_peer_nis;/* chain on remote peer list */ struct list_head lpni_on_remote_peer_ni_list; +/* chain on recovery queue */ +struct list_head lpni_recovery;/* chain on peer hash */ struct list_head lpni_hashlist;/* messages blocking for tx credits */
@@ -529,6 +531,10 @@ struct lnet_peer_ni {lnet_nid_t lpni_nid;/* # refs */ atomic_t lpni_refcount; +/* health value for the peer */ +atomic_t lpni_healthv; +/* recovery ping mdh */ +struct lnet_handle_md lpni_recovery_ping_mdh;/* CPT this peer attached on */ int lpni_cpt;/* state flags -- protected by lpni_lock */
@@ -558,6 +564,10 @@ struct lnet_peer_ni {/* Preferred path added due to traffic on non-MR peer_ni */ #define LNET_PEER_NI_NON_MR_PREF BIT(0) +/* peer is being recovered. */ +#define LNET_PEER_NI_RECOVERY_PENDING BIT(1) +/* peer is being deleted */ +#define LNET_PEER_NI_DELETING BIT(2)struct lnet_peer {/* chain on pt_peer_list */
@@ -1088,6 +1098,8 @@ struct lnet {struct list_head **ln_mt_resendqs;/* local NIs to recover */ struct list_head ln_mt_localNIRecovq; +/* local NIs to recover */ +struct list_head ln_mt_peerNIRecovq;/* recovery eq handler */ struct lnet_handle_eq ln_mt_eqh;
net/lnet/lnet/api-ni.c +1 -0
@@ -832,6 +832,7 @@ struct lnet_libhandle *INIT_LIST_HEAD (&the_lnet.ln_dc_working);INIT_LIST_HEAD (&the_lnet.ln_dc_expired);INIT_LIST_HEAD (&the_lnet.ln_mt_localNIRecovq); +INIT_LIST_HEAD (&the_lnet.ln_mt_peerNIRecovq);init_waitqueue_head (&the_lnet.ln_dc_waitq); rc =lnet_descriptor_setup ();
net/lnet/lnet/lib-move.c +268 -43
426 lines not on this page · raw message
net/lnet/lnet/lib-msg.c +72 -15
132 lines not on this page · raw message
net/lnet/lnet/peer.c +9 -0
@@ -124,6 +124,7 @@INIT_LIST_HEAD (&lpni->lpni_routes);INIT_LIST_HEAD (&lpni->lpni_hashlist);INIT_LIST_HEAD (&lpni->lpni_peer_nis); +INIT_LIST_HEAD (&lpni->lpni_recovery);INIT_LIST_HEAD (&lpni->lpni_on_remote_peer_ni_list);spin_lock_init (&lpni->lpni_lock);
@@ -133,6 +134,7 @@ lpni->lpni_ping_feats =LNET_PING_FEAT_INVAL ; lpni->lpni_nid = nid; lpni->lpni_cpt = cpt; +atomic_set (&lpni->lpni_healthv,LNET_MAX_HEALTH_VALUE );lnet_set_peer_ni_health_locked (lpni, true); net =lnet_get_net_locked (LNET_NIDNET (nid));
@@ -331,6 +333,13 @@/* remove peer ni from the hash list. */ list_del_init (&lpni->lpni_hashlist); +/* indicate the peer is being deleted so the monitor thread can +* remove it from the recovery queue. +*/ +spin_lock (&lpni->lpni_lock); + lpni->lpni_state |=LNET_PEER_NI_DELETING ; +spin_unlock (&lpni->lpni_lock); +/* decrement the ref count on the peer table */ ptable = the_lnet.ln_peer_tables[lpni->lpni_cpt];LASSERT (atomic_read (&ptable->pt_number) >0 );
Signature · 1 line
1.8.3.1
PATCH 83/622 lnet: add retry count
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Added a module parameter to define the number of retries on a message. It defaults to 0, which means no retries will be attempted. Each message will keep track of the number of times it has been retransmitted. When queuing it on the resend queue, the retry count will be checked and if it's exceeded, then the message will be finalized.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 20e23980eae2 ("LU-9120 lnet: add retry count")
Reviewed-on: https://review.whamcloud.com/32769
--- include/linux/lnet/lib-lnet.h | 1 + include/linux/lnet/lib-types.h | 2 ++ net/lnet/lnet/api-ni.c | 5 +++++ net/lnet/lnet/lib-msg.c | 8 +++++++- 4 files changed, 15 insertions(+), 1 deletion(-)
include/linux/lnet/lib-lnet.h +1 -0
@@ -478,6 +478,7 @@ struct lnet_ni *struct lnet_net *lnet_get_net_locked (u32 net_id);extern unsigned int lnet_transaction_timeout; +extern unsigned int lnet_retry_count;extern unsigned int lnet_numa_range;extern unsigned int lnet_health_sensitivity;extern unsigned int lnet_peer_discovery_disabled;
include/linux/lnet/lib-types.h +2 -0
@@ -103,6 +103,8 @@ struct lnet_msg {enum lnet_msg_hstatus msg_health_status;/* This is a recovery message */ bool msg_recovery; +/* the number of times a transmission has been retried */ +int msg_retry_count;/* flag to indicate that we do not want to resend this message */ bool msg_no_resend;
net/lnet/lnet/api-ni.c +5 -0
@@ -116,6 +116,11 @@ struct lnet the_lnet = {MODULE_PARM_DESC (lnet_transaction_timeout,"Time in seconds to wait for a REPLY or an ACK" ); +unsigned int lnet_retry_count; +module_param (lnet_retry_count, uint,0444 ); +MODULE_PARM_DESC (lnet_retry_count, +"Maximum number of times to retry transmitting a message" ); +/* * This sequence number keeps track of how many times DLC was used to * update the local NIs. It is incremented when a NI is added or
net/lnet/lnet/lib-msg.c +7 -1
@@ -556,7 +556,8 @@ }/* Do a health check on the message: -* return -1 if we're not going to handle the error +* return -1 if we're not going to handle the error or +* if we've reached the maximum number of retries. * success case will return -1 as well * return 0 if it the message is requeued for send */
@@ -646,6 +647,11 @@if (msg->msg_no_resend)return -1 ; +/* check if the message has exceeded the number of retries */ +if (msg->msg_retry_count >= lnet_retry_count) +return -1 ; + msg->msg_retry_count++; +lnet_net_lock (msg->msg_tx_cpt);/* remove message from the active list and reset it in preparation
Signature · 1 line
1.8.3.1
PATCH 84/622 lnet: calculate the lnd timeout
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Calculate the LND timeout based on the transaction timeout and the retry count. Both of these are user defined values. Whenever they are set the lnd timeout is calculated. The LNDs use these timeouts instead of the LND timeout module parameter.
Retry count can be set to 0, which means no retries. In that case the LND timeout will default to 5 seconds, which is the same as the default transaction timeout.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 84f3af43c4bd ("LU-9120 lnet: calculate the lnd timeout")
Reviewed-on: https://review.whamcloud.com/32770
--- include/linux/lnet/lib-lnet.h | 2 ++ net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 20 +++++++++++--------- net/lnet/klnds/socklnd/socklnd.c | 6 +++--- net/lnet/klnds/socklnd/socklnd_cb.c | 22 ++++++++++++---------- net/lnet/lnet/api-ni.c | 9 +++++++++ 5 files changed, 37 insertions(+), 22 deletions(-)
include/linux/lnet/lib-lnet.h +2 -0
@@ -85,6 +85,7 @@extern struct kmem_cache *lnet_small_mds_cachep;/* <= LNET_SMALL_MD_SIZE bytes * MDs kmem_cache */ +#define LNET_LND_DEFAULT_TIMEOUT 5static inline int lnet_is_route_alive (struct lnet_route *route) {
@@ -676,6 +677,7 @@ void lnet_copy_kiov2iter(struct iov_iter *to,struct page *lnet_kvaddr_to_page (unsigned long vaddr);int lnet_cpt_of_md (struct lnet_libmd *md,unsigned int offset); +unsigned int lnet_get_lnd_timeout (void );void lnet_register_lnd (struct lnet_lnd *lnd);void lnet_unregister_lnd (struct lnet_lnd *lnd);
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +11 -9
@@ -1205,7 +1205,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,LASSERT (!tx->tx_queued);/* not queued for sending already */ LASSERT (conn->ibc_state >=IBLND_CONN_ESTABLISHED ); - timeout_ns = *kiblnd_tunables.kib_timeout *NSEC_PER_SEC ; + timeout_ns =lnet_get_lnd_timeout () *NSEC_PER_SEC ; tx->tx_queued =1 ; tx->tx_deadline =ktime_add_ns (ktime_get (), timeout_ns);
@@ -1333,14 +1333,14 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,if (*kiblnd_tunables.kib_use_priv_port) { rc =kiblnd_resolve_addr (cmid, &srcaddr, &dstaddr, - *kiblnd_tunables.kib_timeout *1000 ); +lnet_get_lnd_timeout () *1000 ); }else { rc =rdma_resolve_addr (cmid, (struct sockaddr *)&srcaddr, (struct sockaddr *)&dstaddr, - *kiblnd_tunables.kib_timeout *1000 ); +lnet_get_lnd_timeout () *1000 ); } -if (rc) { +if (rc !=0 ) {/* Can't initiate address resolution: */ CERROR ("Can't resolve addr for %s: %d\n" ,libcfs_nid2str (peer_ni->ibp_nid), rc);
@@ -3097,8 +3097,8 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid, event->status); rc = event->status; }else { - rc =rdma_resolve_route ( - cmid, *kiblnd_tunables.kib_timeout *1000 ); + rc =rdma_resolve_route (cmid, +lnet_get_lnd_timeout () *1000 );if (!rc) {struct kib_net *net = peer_ni->ibp_ni->ni_data;struct kib_dev *dev = net->ibn_dev;
@@ -3499,6 +3499,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,const int n =4 ;const int p =1 ;int chunk = kiblnd_data.kib_peer_hash_size; +unsigned int lnd_timeout;spin_unlock_irqrestore (lock, flags); dropped_lock =1 ;
@@ -3512,9 +3513,10 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,* connection within (n+1)/n times the timeout * interval. */ -if (*kiblnd_tunables.kib_timeout > n * p) - chunk = (chunk * n * p) / - *kiblnd_tunables.kib_timeout; + + lnd_timeout =lnet_get_lnd_timeout (); +if (lnd_timeout > n * p) + chunk = (chunk * n * p) / lnd_timeout;if (!chunk) chunk =1 ;
net/lnet/klnds/socklnd/socklnd.c +3 -3
@@ -1284,7 +1284,7 @@ struct ksock_peer */* Set the deadline for the outgoing HELLO to drain */ conn->ksnc_tx_bufnob = sock->sk->sk_wmem_queued; conn->ksnc_tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout ();mb ();/* order with adding to peer_ni's conn list */ list_add (&conn->ksnc_list, &peer_ni->ksnp_conns);
@@ -1674,7 +1674,7 @@ struct ksock_peer *switch (conn->ksnc_rx_state) {case SOCKNAL_RX_LNET_PAYLOAD : last_rcv = conn->ksnc_rx_deadline - - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout (); CERROR("Completing partial receive from %s[%d], ip %pI4h:%d, with error, wanted: %zd, left: %d, last alive is %lld secs ago\n", libcfs_id2str(conn->ksnc_peer->ksnp_id), conn->ksnc_type, &conn->ksnc_ipaddr, conn->ksnc_port,
@@ -1849,7 +1849,7 @@ struct ksock_peer *if (bufnob < conn->ksnc_tx_bufnob) {/* something got ACKed */ conn->ksnc_tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout (); peer_ni->ksnp_last_alive = now; conn->ksnc_tx_bufnob = bufnob; }
net/lnet/klnds/socklnd/socklnd_cb.c +12 -10
@@ -222,7 +222,7 @@ struct ksock_tx ** something got ACKed */ conn->ksnc_tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout (); conn->ksnc_peer->ksnp_last_alive =ktime_get_seconds (); conn->ksnc_tx_bufnob = bufnob;mb ();
@@ -268,7 +268,7 @@ struct ksock_tx * conn->ksnc_peer->ksnp_last_alive =ktime_get_seconds (); conn->ksnc_rx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout ();mb ();/* order with setting rx_started */ conn->ksnc_rx_started =1 ;
@@ -423,7 +423,7 @@ struct ksock_tx */* ZC_REQ is going to be pinned to the peer_ni */ tx->tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout ();LASSERT (!tx->tx_msg.ksm_zc_cookies[0 ]);
@@ -705,7 +705,7 @@ struct ksock_conn *if (list_empty (&conn->ksnc_tx_queue) && !bufnob) {/* First packet starts the timeout */ conn->ksnc_tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout ();if (conn->ksnc_tx_bufnob >0 )/* something got ACKed */ conn->ksnc_peer->ksnp_last_alive =ktime_get_seconds (); conn->ksnc_tx_bufnob =0 ;
@@ -881,7 +881,7 @@ struct ksock_route * ksocknal_find_connecting_route_locked(peer_ni)) {/* the message is going to be pinned to the peer_ni */ tx->tx_deadline =ktime_get_seconds () + - *ksocknal_tunables.ksnd_timeout; +lnet_get_lnd_timeout ();/* Queue the message until a connection is established */ list_add_tail (&tx->tx_list, &peer_ni->ksnp_tx_queue);
@@ -1663,7 +1663,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)/* socket type set on active connections - not set on passive */ LASSERT (!active == !(conn->ksnc_type !=SOCKLND_CONN_NONE )); - timeout = active ? *ksocknal_tunables.ksnd_timeout : + timeout = active ?lnet_get_lnd_timeout () :lnet_acceptor_timeout (); rc = lnet_sock_read(sock, &hello->kshm_magic,
@@ -1801,7 +1801,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)int retry_later =0 ;int rc =0 ; - deadline =ktime_get_seconds () + *ksocknal_tunables.ksnd_timeout; + deadline =ktime_get_seconds () +lnet_get_lnd_timeout ();write_lock_bh (&ksocknal_data.ksnd_global_lock);
@@ -2552,6 +2552,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)const int n =4 ;const int p =1 ;int chunk = ksocknal_data.ksnd_peer_hash_size; +unsigned int lnd_timeout;/* * Time to check for timeouts on a few more peers: I do
@@ -2561,9 +2562,10 @@ void ksocknal_write_callback(struct ksock_conn *conn)* timeout on any connection within (n+1)/n times the * timeout interval. */ -if (*ksocknal_tunables.ksnd_timeout > n * p) - chunk = (chunk * n * p) / - *ksocknal_tunables.ksnd_timeout; + + lnd_timeout =lnet_get_lnd_timeout (); +if (lnd_timeout > n * p) + chunk = (chunk * n * p) / lnd_timeout;if (!chunk) chunk =1 ;
net/lnet/lnet/api-ni.c +9 -0
@@ -121,6 +121,8 @@ struct lnet the_lnet = {MODULE_PARM_DESC (lnet_retry_count,"Maximum number of times to retry transmitting a message" ); +unsigned int lnet_lnd_timeout =LNET_LND_DEFAULT_TIMEOUT ; +/* * This sequence number keeps track of how many times DLC was used to * update the local NIs. It is incremented when a NI is added or
@@ -570,6 +572,13 @@ static void lnet_assert_wire_constants(void)return NULL ; } +unsigned int +lnet_get_lnd_timeout (void ) +{ +return lnet_lnd_timeout; +} +EXPORT_SYMBOL (lnet_get_lnd_timeout); +void lnet_register_lnd (struct lnet_lnd *lnd) {
Signature · 1 line
1.8.3.1
PATCH 85/622 lnet: sysfs functions for module params
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Allow transaction timeout and retry count module parameters to be set and shown via sysfs.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 5169827bf790 ("LU-9120 lnet: sysfs functions for module params")
Reviewed-on: https://review.whamcloud.com/32861
--- net/lnet/lnet/api-ni.c | 84 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 7 deletions(-)
net/lnet/lnet/api-ni.c +77 -7
@@ -111,13 +111,27 @@ struct lnet the_lnet = {unsigned int lnet_transaction_timeout =5 ;static int transaction_to_set (const char *val,const struct kernel_param *kp); -module_param_call (lnet_transaction_timeout, transaction_to_set, param_get_int, - &lnet_transaction_timeout,0444 ); +static struct kernel_param_ops param_ops_transaction_timeout = { + .set = transaction_to_set, + .get = param_get_int, +}; + +#define param_check_transaction_timeout (name, p) \ + __param_check(name, p, int) +module_param (lnet_transaction_timeout, transaction_timeout,0644 );MODULE_PARM_DESC (lnet_transaction_timeout, -"Time in seconds to wait for a REPLY or an ACK" ); +"Maximum number of seconds to wait for a peer response." );unsigned int lnet_retry_count; -module_param (lnet_retry_count, uint,0444 ); +static int retry_count_set (const char *val,const struct kernel_param *kp); +static struct kernel_param_ops param_ops_retry_count = { + .set = retry_count_set, + .get = param_get_int, +}; + +#define param_check_retry_count (name, p) \ + __param_check(name, p, int) +module_param (lnet_retry_count, retry_count,0644 );MODULE_PARM_DESC (lnet_retry_count,"Maximum number of times to retry transmitting a message" );
@@ -241,10 +255,15 @@ static int lnet_discover(struct lnet_process_id id, u32 force,*/ mutex_lock (&the_lnet.ln_api_mutex); -if (value ==0 ) { +if (the_lnet.ln_state !=LNET_STATE_RUNNING ) { +mutex_unlock (&the_lnet.ln_api_mutex); +return 0 ; + } + +if (value < lnet_retry_count || value ==0 ) {mutex_unlock (&the_lnet.ln_api_mutex); -CERROR ("Invalid value for lnet_transaction_timeout (%lu).\n" , - value); +CERROR ("Invalid value for lnet_transaction_timeout (%lu). Has to be greater than lnet_retry_count (%u)\n" , + value, lnet_retry_count);return -EINVAL ; }
@@ -254,6 +273,57 @@ static int lnet_discover(struct lnet_process_id id, u32 force, } *transaction_to = value; +if (lnet_retry_count ==0 ) + lnet_lnd_timeout = value; +else + lnet_lnd_timeout = value / lnet_retry_count; + +mutex_unlock (&the_lnet.ln_api_mutex); + +return 0 ; +} + +static int +retry_count_set (const char *val,const struct kernel_param *kp) +{ +int rc; +unsigned int *retry_count = (unsigned int *)kp->arg; +unsigned long value; + + rc =kstrtoul (val,0 , &value); +if (rc) { +CERROR ("Invalid module parameter value for 'lnet_retry_count'\n" ); +return rc; + } + +/* The purpose of locking the api_mutex here is to ensure that +* the correct value ends up stored properly. +*/ +mutex_lock (&the_lnet.ln_api_mutex); + +if (the_lnet.ln_state !=LNET_STATE_RUNNING ) { +mutex_unlock (&the_lnet.ln_api_mutex); +return 0 ; + } + +if (value > lnet_transaction_timeout) { +mutex_unlock (&the_lnet.ln_api_mutex); +CERROR ("Invalid value for lnet_retry_count (%lu). Has to be smaller than lnet_transaction_timeout (%u)\n" , + value, lnet_transaction_timeout); +return -EINVAL ; + } + +if (value == *retry_count) { +mutex_unlock (&the_lnet.ln_api_mutex); +return 0 ; + } + + *retry_count = value; + +if (value ==0 ) + lnet_lnd_timeout = lnet_transaction_timeout; +else + lnet_lnd_timeout = lnet_transaction_timeout / value;mutex_unlock (&the_lnet.ln_api_mutex);
Signature · 1 line
1.8.3.1
PATCH 86/622 lnet: timeout delayed REPLYs and ACKs
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
When a GET or a PUT which require an ACK are sent, add a response tracker block on a percpt queue. When the REPLY/ACK are received then remove the block from the percpt queue. The monitor thread will wake up periodically to check if any of the blocks have expired and if so, it will send a timeout event to the ULP and flag the MD as stale, then unlink.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: a57fa1176e74 ("LU-9120 lnet: timeout delayed REPLYs and ACKs")
Reviewed-on: https://review.whamcloud.com/32771
--- include/linux/lnet/lib-lnet.h | 20 ++++ include/linux/lnet/lib-types.h | 20 ++++ net/lnet/lnet/lib-move.c | 210 ++++++++++++++++++++++++++++++++++++++++- net/lnet/lnet/lib-msg.c | 9 ++ 4 files changed, 258 insertions(+), 1 deletion(-)
include/linux/lnet/lib-lnet.h +20 -0
@@ -438,6 +438,25 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,lnet_net_unlock (0 ); } +static inline struct lnet_rsp_tracker * +lnet_rspt_alloc (int cpt) +{ +struct lnet_rsp_tracker *rspt; + + rspt =kzalloc (sizeof (*rspt),GFP_NOFS ); +lnet_net_lock (cpt); +lnet_net_unlock (cpt); +return rspt; +} + +static inline void +lnet_rspt_free (struct lnet_rsp_tracker *rspt,int cpt) +{ +kfree (rspt); +lnet_net_lock (cpt); +lnet_net_unlock (cpt); +} +void lnet_ni_free (struct lnet_ni *ni);void lnet_net_free (struct lnet_net *net);
@@ -614,6 +633,7 @@ struct lnet_msg *lnet_create_reply_msg(struct lnet_ni *ni, struct lnet_msg *get_msg);void lnet_set_reply_msg_len (struct lnet_ni *ni,struct lnet_msg *msg,unsigned int len); +void lnet_detach_rsp_tracker (struct lnet_libmd *md,int cpt);void lnet_finalize (struct lnet_msg *msg,int rc);
include/linux/lnet/lib-types.h +20 -0
@@ -75,6 +75,17 @@ enum lnet_msg_hstatus {LNET_MSG_STATUS_NETWORK_TIMEOUT }; +struct lnet_rsp_tracker { +/* chain on the waiting list */ +struct list_head rspt_on_list; +/* cpt to lock */ +int rspt_cpt; +/* deadline of the REPLY/ACK */ +ktime_t rspt_deadline; +/* parent MD */ +struct lnet_handle_md rspt_mdh; +}; +struct lnet_msg {struct list_head msg_activelist;struct list_head msg_list;/* Q for credits/MD */
@@ -201,6 +212,7 @@ struct lnet_libmd {unsigned int md_flags;unsigned int md_niov;/* # frags at end of struct */ void *md_user_ptr; +struct lnet_rsp_tracker *md_rspt_ptr;struct lnet_eq *md_eq;struct lnet_handle_md md_bulk_handle;union {
@@ -1102,6 +1114,14 @@ struct lnet {struct list_head ln_mt_localNIRecovq;/* local NIs to recover */ struct list_head ln_mt_peerNIRecovq; +/* +* An array of queues for GET/PUT waiting for REPLY/ACK respectively. +* There are CPT number of queues. Since response trackers will be +* added on the fast path we can't afford to grab the exclusive +* net lock to protect these queues. The CPT will be calculated +* based on the mdh cookie. +*/ +struct list_head **ln_mt_rstq;/* recovery eq handler */ struct lnet_handle_eq ln_mt_eqh;
net/lnet/lnet/lib-move.c +209 -1
324 lines not on this page · raw message
net/lnet/lnet/lib-msg.c +9 -0
@@ -777,6 +777,15 @@ msg->msg_ev.status = status; +/* if this is an ACK or a REPLY then make sure to remove the +* response tracker. +*/ +if (msg->msg_ev.type ==LNET_EVENT_REPLY || + msg->msg_ev.type ==LNET_EVENT_ACK ) { + cpt =lnet_cpt_of_cookie (msg->msg_md->md_lh.lh_cookie); +lnet_detach_rsp_tracker (msg->msg_md, cpt); + } +/* if the message is successfully sent, no need to keep the MD around */ if (msg->msg_md && !status)lnet_detach_md (msg, status);
Signature · 1 line
1.8.3.1
PATCH 87/622 lnet: remove duplicate timeout mechanism
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Remove the duplicate GET/PUT timeout mechanism currently implemented for discovery, as it has been replaced by a more generic timeout mechanism for all GET/PUT messages.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 0b1947d14188 ("LU-9120 lnet: remove duplicate timeout mechanism")
Reviewed-on: https://review.whamcloud.com/32992
--- net/lnet/lnet/peer.c | 39 --------------------------------------- 1 file changed, 39 deletions(-)
net/lnet/lnet/peer.c +0 -39
@@ -2925,25 +2925,6 @@ static int lnet_peer_rediscover(struct lnet_peer *lp) }/* -* Returns the first peer on the ln_dc_working queue if its timeout -* has expired. Takes the current time as an argument so as to not -* obsessively re-check the clock. The oldest discovery request will -* be at the head of the queue. -*/ -static struct lnet_peer *lnet_peer_get_dc_timed_out (time64_t now) -{ -struct lnet_peer *lp; - -if (list_empty (&the_lnet.ln_dc_working)) -return NULL ; - lp =list_first_entry (&the_lnet.ln_dc_working, - struct lnet_peer, lp_dc_list); -if (now < lp->lp_last_queued + lnet_transaction_timeout) -return NULL ; -return lp; -} - -/* * Discovering this peer is taking too long. Cancel any Ping or Push * that discovery is waiting on by unlinking the relevant MDs. The * lnet_discovery_event_handler() will proceed from here and complete
@@ -2998,8 +2979,6 @@ static int lnet_peer_discovery_wait_for_work(void)break ;if (!list_empty (&the_lnet.ln_msg_resend))break ; -if (lnet_peer_get_dc_timed_out (ktime_get_real_seconds ())) -break ;lnet_net_unlock (cpt);/*
@@ -3068,7 +3047,6 @@ static void lnet_resend_msgs(void)static int lnet_peer_discovery (void *arg) {struct lnet_peer *lp; -time64_t now;int rc;CDEBUG (D_NET ,"started\n" );
@@ -3159,23 +3137,6 @@ static int lnet_peer_discovery(void *arg)break ; } -/* -* Now that the ln_dc_request queue has been emptied -* check the ln_dc_working queue for peers that are -* taking too long. Move all that are found to the -* ln_dc_expired queue and time out any pending -* Ping or Push. We have to drop the lnet_net_lock -* in the loop because lnet_peer_cancel_discovery() -* calls LNetMDUnlink(). -*/ - now =ktime_get_real_seconds (); -while ((lp =lnet_peer_get_dc_timed_out (now)) !=NULL ) { -list_move (&lp->lp_dc_list, &the_lnet.ln_dc_expired); -lnet_net_unlock (LNET_LOCK_EX ); -lnet_peer_cancel_discovery (lp); -lnet_net_lock (LNET_LOCK_EX ); - } -lnet_net_unlock (LNET_LOCK_EX ); }
Signature · 1 line
1.8.3.1
PATCH 88/622 lnet: handle fatal device error
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
The o2iblnd can receive device status on the QP event handler. There are three in specific that are being handled in this patch:IB_EVENT_DEVICE_FATALIB_EVENT_PORT_ERRIB_EVENT_PORT_ACTIVE
For DEVICE_FATAL and PORT_ERR the NI associated with the QP is set in fatal error mode. This NI will no longer be selected when sending messages. When PORT_ACTIVE is received the NI associated with the QP has the fatal error cleared and future messages can use that NI.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 6b1571209a99 ("LU-9120 lnet: handle fatal device error")
Reviewed-on: https://review.whamcloud.com/32772
--- include/linux/lnet/lib-types.h | 7 +++++++ net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 13 +++++++++++++ net/lnet/lnet/lib-move.c | 6 +++++- 3 files changed, 25 insertions(+), 1 deletion(-)
include/linux/lnet/lib-types.h +7 -0
@@ -443,6 +443,13 @@ struct lnet_ni {atomic_t ni_healthv;/* +* Set to 1 by the LND when it receives an event telling it the device +* has gone into a fatal state. Set to 0 when the LND receives an +* even telling it the device is back online. +*/ +atomic_t ni_fatal_error_on; + +/* * equivalent interfaces to use * This is an array because socklnd bonding can still be configured */
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +13 -0
@@ -3567,6 +3567,19 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,rdma_notify (conn->ibc_cmid,IB_EVENT_COMM_EST );return ; +case IB_EVENT_PORT_ERR : +case IB_EVENT_DEVICE_FATAL : +CERROR ("Fatal device error for NI %s\n" , +libcfs_nid2str (conn->ibc_peer->ibp_ni->ni_nid)); +atomic_set (&conn->ibc_peer->ibp_ni->ni_fatal_error_on,1 ); +return ; + +case IB_EVENT_PORT_ACTIVE : +CERROR ("Port reactivated for NI %s\n" , +libcfs_nid2str (conn->ibc_peer->ibp_ni->ni_nid)); +atomic_set (&conn->ibc_peer->ibp_ni->ni_fatal_error_on,0 ); +return ; +default :CERROR ("%s: Async QP event type %d\n" ,libcfs_nid2str (conn->ibc_peer->ibp_nid), event->event);
net/lnet/lnet/lib-move.c +5 -1
@@ -1303,9 +1303,11 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,unsigned int distance;int ni_credits;int ni_healthv; +int ni_fatal; ni_credits =atomic_read (&ni->ni_tx_credits); ni_healthv =atomic_read (&ni->ni_healthv); + ni_fatal =atomic_read (&ni->ni_fatal_error_on);/* * calculate the distance from the CPT on which
@@ -1334,7 +1336,9 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,* Select on health, shorter distance, available * credits, then round-robin. */ -if (ni_healthv < best_healthv) { +if (ni_fatal) { +continue ; + }else if (ni_healthv < best_healthv) {continue ; }else if (ni_healthv > best_healthv) { best_healthv = ni_healthv;
Signature · 1 line
1.8.3.1
PATCH 89/622 lnet: reset health value
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Added an IOCTL to set the local or peer ni health value. This would be useful in debugging where we can test the selection algorithm and recovery mechanism by reducing the health of an interface.
If the value specified is -1 then reset the health value to maximum. This is useful to reset the system once a network issue has been resolved. There would be no need to wait for the interface to go to fully healthy on its own. It might be desirable to shortcut the process.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 2f5a6d1233ac ("LU-9120 lnet: reset health value")
Lustre-commit: b04c35874dca ("LU-11283 lnet: fix setting health value manually")
Reviewed-on: https://review.whamcloud.com/32773
--- include/linux/lnet/lib-lnet.h | 2 ++ include/uapi/linux/lnet/libcfs_ioctl.h | 3 +- include/uapi/linux/lnet/lnet-dlc.h | 14 ++++++++ net/lnet/lnet/api-ni.c | 51 +++++++++++++++++++++++++++ net/lnet/lnet/lib-msg.c | 16 +-------- net/lnet/lnet/peer.c | 64 ++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 16 deletions(-)
include/linux/lnet/lib-lnet.h +2 -0
@@ -524,6 +524,8 @@ struct lnet_ni *lnet_get_next_ni_locked(struct lnet_net *mynet,struct lnet_ni *lnet_get_ni_idx_locked (int idx);int lnet_get_peer_list (u32 *countp,u32 *sizep,struct lnet_process_id __user *ids); +extern void lnet_peer_ni_set_healthv (lnet_nid_t nid,int value,bool all); +extern void lnet_peer_ni_add_to_recoveryq_locked (struct lnet_peer_ni *lpni);void lnet_router_debugfs_init (void );void lnet_router_debugfs_fini (void );
include/uapi/linux/lnet/libcfs_ioctl.h +2 -1
@@ -148,6 +148,7 @@ struct libcfs_debug_ioctl_data {#define IOC_LIBCFS_GET_NUMA_RANGE _IOWR(IOC_LIBCFS_TYPE, 99, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_GET_PEER_LIST _IOWR(IOC_LIBCFS_TYPE, 100, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_GET_LOCAL_NI_MSG_STATS _IOWR(IOC_LIBCFS_TYPE, 101, IOCTL_CONFIG_SIZE) -#define IOC_LIBCFS_MAX_NR 101 +#define IOC_LIBCFS_SET_HEALHV _IOWR(IOC_LIBCFS_TYPE, 102, IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_MAX_NR 102#endif /* __LIBCFS_IOCTL_H__ */
include/uapi/linux/lnet/lnet-dlc.h +14 -0
@@ -230,6 +230,20 @@ struct lnet_ioctl_peer_cfg {void __user *prcfg_bulk; }; + +enum lnet_health_type { +LNET_HEALTH_TYPE_LOCAL_NI =0 , +LNET_HEALTH_TYPE_PEER_NI , +}; + +struct lnet_ioctl_reset_health_cfg { +struct libcfs_ioctl_hdr rh_hdr; +enum lnet_health_type rh_type; +bool rh_all; +int rh_value; +lnet_nid_t rh_nid; +}; +struct lnet_ioctl_set_value {struct libcfs_ioctl_hdr sv_hdr;__u32 sv_value;
net/lnet/lnet/api-ni.c +51 -0
63 lines not on this page · raw message
net/lnet/lnet/lib-msg.c +1 -15
@@ -530,12 +530,6 @@return ;lnet_net_lock (0 ); -/* the mt could've shutdown and cleaned up the queues */ -if (the_lnet.ln_mt_state !=LNET_MT_STATE_RUNNING ) { -lnet_net_unlock (0 ); -return ; - } -lnet_dec_healthv_locked (&lpni->lpni_healthv);/* add the peer NI to the recovery queue if it's not already there * and it's health value is actually below the maximum. It's
@@ -543,15 +537,7 @@* value will not be reduced. In this case, there is no reason to * invoke recovery */ -if (list_empty (&lpni->lpni_recovery) && -atomic_read (&lpni->lpni_healthv) <LNET_MAX_HEALTH_VALUE ) { -CERROR ("lpni %s added to recovery queue. Health = %d\n" , -libcfs_nid2str (lpni->lpni_nid), -atomic_read (&lpni->lpni_healthv)); -list_add_tail (&lpni->lpni_recovery, - &the_lnet.ln_mt_peerNIRecovq); -lnet_peer_ni_addref_locked (lpni); - } +lnet_peer_ni_add_to_recoveryq_locked (lpni);lnet_net_unlock (0 ); }
net/lnet/lnet/peer.c +64 -0
67 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 90/622 lnet: add health statistics
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add a health statistics block for each local and peer NI. These statistics will be incremented when processing errors reported by lnet_finalize()
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 67908ab34371 ("LU-9120 lnet: add health statistics")
Reviewed-on: https://review.whamcloud.com/32775
--- include/linux/lnet/lib-types.h | 18 +++++++++++++++ net/lnet/lnet/lib-msg.c | 52 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 68 insertions(+), 2 deletions(-)
include/linux/lnet/lib-types.h +18 -0
@@ -338,6 +338,22 @@ struct lnet_element_stats {struct lnet_comm_count el_drop_stats; }; +struct lnet_health_local_stats { +atomic_t hlt_local_interrupt; +atomic_t hlt_local_dropped; +atomic_t hlt_local_aborted; +atomic_t hlt_local_no_route; +atomic_t hlt_local_timeout; +atomic_t hlt_local_error; +}; + +struct lnet_health_remote_stats { +atomic_t hlt_remote_dropped; +atomic_t hlt_remote_timeout; +atomic_t hlt_remote_error; +atomic_t hlt_network_timeout; +}; +struct lnet_net {/* chain on the ln_nets */ struct list_head net_list;
@@ -426,6 +442,7 @@ struct lnet_ni {/* NI statistics */ struct lnet_element_stats ni_stats; +struct lnet_health_local_stats ni_hstats;/* physical device CPT */ int ni_dev_cpt;
@@ -511,6 +528,7 @@ struct lnet_peer_ni {struct list_head lpni_rtr_list;/* statistics kept on each peer NI */ struct lnet_element_stats lpni_stats; +struct lnet_health_remote_stats lpni_hstats;/* spin lock protecting credits and lpni_txq / lpni_rtrq */ spinlock_t lpni_lock;/* # tx credits available */
net/lnet/lnet/lib-msg.c +50 -2
70 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 91/622 lnet: Add ioctl to get health stats
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
At the time of this patch the sysfs statistics features is still in development. Therefore, using ioctl to get the stats from LNet.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 10958cac798d ("LU-9120 lnet: Add ioctl to get health stats")
Reviewed-on: https://review.whamcloud.com/32776
--- include/linux/lnet/lib-lnet.h | 1 + include/uapi/linux/lnet/libcfs_ioctl.h | 3 ++- include/uapi/linux/lnet/lnet-dlc.h | 31 ++++++++++++++++----- net/lnet/lnet/api-ni.c | 49 ++++++++++++++++++++++++++++++++++ net/lnet/lnet/peer.c | 29 ++++++++++++++++---- 5 files changed, 101 insertions(+), 12 deletions(-)
include/linux/lnet/lib-lnet.h +1 -0
@@ -823,6 +823,7 @@ int lnet_get_peer_ni_info(u32 peer_index, u64 *nid, u32 *ni_peer_tx_credits, u32 *peer_tx_credits, u32 *peer_rtr_credits, u32 *peer_min_rtr_credtis, u32 *peer_tx_qnob); +int lnet_get_peer_ni_hstats (struct lnet_ioctl_peer_ni_hstats *stats);static inline bool lnet_is_peer_ni_healthy_locked (struct lnet_peer_ni *lpni)
include/uapi/linux/lnet/libcfs_ioctl.h +2 -1
@@ -149,6 +149,7 @@ struct libcfs_debug_ioctl_data {#define IOC_LIBCFS_GET_PEER_LIST _IOWR(IOC_LIBCFS_TYPE, 100, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_GET_LOCAL_NI_MSG_STATS _IOWR(IOC_LIBCFS_TYPE, 101, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_SET_HEALHV _IOWR(IOC_LIBCFS_TYPE, 102, IOCTL_CONFIG_SIZE) -#define IOC_LIBCFS_MAX_NR 102 +#define IOC_LIBCFS_GET_LOCAL_HSTATS _IOWR(IOC_LIBCFS_TYPE, 103, IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_MAX_NR 103#endif /* __LIBCFS_IOCTL_H__ */
include/uapi/linux/lnet/lnet-dlc.h +25 -6
@@ -163,6 +163,31 @@ struct lnet_ioctl_element_stats {__u32 iel_drop_count; }; +enum lnet_health_type { +LNET_HEALTH_TYPE_LOCAL_NI =0 , +LNET_HEALTH_TYPE_PEER_NI , +}; + +struct lnet_ioctl_local_ni_hstats { +struct libcfs_ioctl_hdr hlni_hdr; +lnet_nid_t hlni_nid; +__u32 hlni_local_interrupt; +__u32 hlni_local_dropped; +__u32 hlni_local_aborted; +__u32 hlni_local_no_route; +__u32 hlni_local_timeout; +__u32 hlni_local_error; +__s32 hlni_health_value; +}; + +struct lnet_ioctl_peer_ni_hstats { +__u32 hlpni_remote_dropped; +__u32 hlpni_remote_timeout; +__u32 hlpni_remote_error; +__u32 hlpni_network_timeout; +__s32 hlpni_health_value; +}; +struct lnet_ioctl_element_msg_stats {struct libcfs_ioctl_hdr im_hdr;__u32 im_idx;
@@ -230,12 +255,6 @@ struct lnet_ioctl_peer_cfg {void __user *prcfg_bulk; }; - -enum lnet_health_type { -LNET_HEALTH_TYPE_LOCAL_NI =0 , -LNET_HEALTH_TYPE_PEER_NI , -}; -struct lnet_ioctl_reset_health_cfg {struct libcfs_ioctl_hdr rh_hdr;enum lnet_health_type rh_type;
net/lnet/lnet/api-ni.c +49 -0
61 lines not on this page · raw message
net/lnet/lnet/peer.c +24 -5
@@ -3339,6 +3339,7 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk) {struct lnet_ioctl_element_stats *lpni_stats;struct lnet_ioctl_element_msg_stats *lpni_msg_stats; +struct lnet_ioctl_peer_ni_hstats *lpni_hstats;struct lnet_peer_ni_credit_info *lpni_info;struct lnet_peer_ni *lpni;struct lnet_peer *lp;
@@ -3354,7 +3355,7 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk) } size =sizeof (nid) +sizeof (*lpni_info) +sizeof (*lpni_stats) + -sizeof (*lpni_msg_stats); +sizeof (*lpni_msg_stats) +sizeof (*lpni_hstats); size *= lp->lp_nnis;if (size > cfg->prcfg_size) { cfg->prcfg_size = size;
@@ -3380,6 +3381,9 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk) lpni_msg_stats =kzalloc (sizeof (*lpni_msg_stats),GFP_KERNEL );if (!lpni_msg_stats) goto out_free_stats; + lpni_hstats =kzalloc (sizeof (*lpni_hstats),GFP_NOFS ); +if (!lpni_hstats) + goto out_free_msg_stats; lpni =NULL ;
@@ -3387,7 +3391,7 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk)while ((lpni =lnet_get_next_peer_ni_locked (lp,NULL , lpni)) !=NULL ) { nid = lpni->lpni_nid;if (copy_to_user (bulk, &nid,sizeof (nid))) - goto out_free_msg_stats; + goto out_free_hstats; bulk +=sizeof (nid);memset (lpni_info,0 ,sizeof (*lpni_info));
@@ -3406,7 +3410,7 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk) lpni_info->cr_peer_min_tx_credits = lpni->lpni_mintxcredits; lpni_info->cr_peer_tx_qnob = lpni->lpni_txqnob;if (copy_to_user (bulk, lpni_info,sizeof (*lpni_info))) - goto out_free_msg_stats; + goto out_free_hstats; bulk +=sizeof (*lpni_info);memset (lpni_stats,0 ,sizeof (*lpni_stats));
@@ -3417,15 +3421,30 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk) lpni_stats->iel_drop_count =lnet_sum_stats (&lpni->lpni_stats,LNET_STATS_TYPE_DROP );if (copy_to_user (bulk, lpni_stats,sizeof (*lpni_stats))) - goto out_free_msg_stats; + goto out_free_hstats; bulk +=sizeof (*lpni_stats);lnet_usr_translate_stats (lpni_msg_stats, &lpni->lpni_stats);if (copy_to_user (bulk, lpni_msg_stats,sizeof (*lpni_msg_stats))) - goto out_free_msg_stats; + goto out_free_hstats; bulk +=sizeof (*lpni_msg_stats); + lpni_hstats->hlpni_network_timeout = +atomic_read (&lpni->lpni_hstats.hlt_network_timeout); + lpni_hstats->hlpni_remote_dropped = +atomic_read (&lpni->lpni_hstats.hlt_remote_dropped); + lpni_hstats->hlpni_remote_timeout = +atomic_read (&lpni->lpni_hstats.hlt_remote_timeout); + lpni_hstats->hlpni_remote_error = +atomic_read (&lpni->lpni_hstats.hlt_remote_error); + lpni_hstats->hlpni_health_value = +atomic_read (&lpni->lpni_healthv); +if (copy_to_user (bulk, lpni_hstats,sizeof (*lpni_hstats))) + goto out_free_hstats; + bulk +=sizeof (*lpni_hstats); } rc =0 ; +out_free_hstats: +kfree (lpni_hstats); out_free_msg_stats:kfree (lpni_msg_stats); out_free_stats:
Signature · 1 line
1.8.3.1
PATCH 92/622 lnet: remove obsolete health functions
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Removed obsolete health functions that were originally added during the Multi-Rail project. Some assumptions were made about the health implementation back then, that are no longer true.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: ba05b3a98a0c ("LU-9120 lnet: remove obsolete health functions")
Reviewed-on: https://review.whamcloud.com/32862
--- include/linux/lnet/lib-lnet.h | 40 ---------------------------------------- net/lnet/lnet/api-ni.c | 9 --------- net/lnet/lnet/lib-move.c | 6 ------ net/lnet/lnet/peer.c | 8 -------- 4 files changed, 63 deletions(-)
include/linux/lnet/lib-lnet.h +0 -40
@@ -494,7 +494,6 @@ struct lnet_ni *struct lnet_ni *lnet_nid2ni_addref (lnet_nid_t nid);struct lnet_ni *lnet_net2ni_locked (u32 net,int cpt);struct lnet_ni *lnet_net2ni_addref (u32 net); -bool lnet_is_ni_healthy_locked (struct lnet_ni *ni);struct lnet_net *lnet_get_net_locked (u32 net_id);extern unsigned int lnet_transaction_timeout;
@@ -825,45 +824,6 @@ int lnet_get_peer_ni_info(u32 peer_index, u64 *nid, u32 *peer_tx_qnob);int lnet_get_peer_ni_hstats (struct lnet_ioctl_peer_ni_hstats *stats); -static inline bool -lnet_is_peer_ni_healthy_locked (struct lnet_peer_ni *lpni) -{ -return lpni->lpni_healthy; -} - -static inline void -lnet_set_peer_ni_health_locked (struct lnet_peer_ni *lpni,bool health) -{ - lpni->lpni_healthy = health; -} - -static inline bool -lnet_is_peer_net_healthy_locked (struct lnet_peer_net *peer_net) -{ -struct lnet_peer_ni *lpni; - -list_for_each_entry (lpni, &peer_net->lpn_peer_nis, - lpni_peer_nis) { -if (lnet_is_peer_ni_healthy_locked (lpni)) -return true; - } - -return false; -} - -static inline bool -lnet_is_peer_healthy_locked (struct lnet_peer *peer) -{ -struct lnet_peer_net *peer_net; - -list_for_each_entry (peer_net, &peer->lp_peer_nets, lpn_peer_nets) { -if (lnet_is_peer_net_healthy_locked (peer_net)) -return true; - } - -return false; -} -static inline struct lnet_peer_net *lnet_find_peer_net_locked (struct lnet_peer *peer,u32 net_id) {
net/lnet/lnet/api-ni.c +0 -9
@@ -1155,15 +1155,6 @@ struct lnet_net *return !!net; } -bool -lnet_is_ni_healthy_locked (struct lnet_ni *ni) -{ -if (ni->ni_state &LNET_NI_STATE_ACTIVE ) -return true; - -return false; -} -struct lnet_ni *lnet_nid2ni_locked (lnet_nid_t nid,int cpt) {
net/lnet/lnet/lib-move.c +0 -6
@@ -2323,12 +2323,6 @@ struct lnet_ni * }lnet_peer_ni_decref_locked (lpni); -/* If peer is not healthy then can not send anything to it */ -if (!lnet_is_peer_healthy_locked (peer)) { -lnet_net_unlock (cpt); -return -EHOSTUNREACH ; - } -/* Identify the different send cases */ if (src_nid ==LNET_NID_ANY )
net/lnet/lnet/peer.c +0 -8
@@ -135,7 +135,6 @@ lpni->lpni_nid = nid; lpni->lpni_cpt = cpt;atomic_set (&lpni->lpni_healthv,LNET_MAX_HEALTH_VALUE ); -lnet_set_peer_ni_health_locked (lpni, true); net =lnet_get_net_locked (LNET_NIDNET (nid)); lpni->lpni_net = net;
@@ -2694,8 +2693,6 @@ static lnet_nid_t lnet_peer_select_nid(struct lnet_peer *lp)/* Look for a direct-connected NID for this peer. */ lpni =NULL ;while ((lpni =lnet_get_next_peer_ni_locked (lp,NULL , lpni)) !=NULL ) { -if (!lnet_is_peer_ni_healthy_locked (lpni)) -continue ;if (!lnet_get_net_locked (lpni->lpni_peer_net->lpn_net_id))continue ;break ;
@@ -2706,8 +2703,6 @@ static lnet_nid_t lnet_peer_select_nid(struct lnet_peer *lp)/* Look for a routed-connected NID for this peer. */ lpni =NULL ;while ((lpni =lnet_get_next_peer_ni_locked (lp,NULL , lpni)) !=NULL ) { -if (!lnet_is_peer_ni_healthy_locked (lpni)) -continue ;if (!lnet_find_rnet_locked (lpni->lpni_peer_net->lpn_net_id))continue ;break ;
@@ -3082,9 +3077,6 @@ static int lnet_peer_discovery(void *arg)* forever, in case the GET message (for ping) * doesn't get a REPLY or the PUT message (for * push) doesn't get an ACK. -* -* TODO: LNet Health will deal with this scenario -* in a generic way. */ lp->lp_last_queued =ktime_get_real_seconds ();lnet_net_unlock (LNET_LOCK_EX );
Signature · 1 line
1.8.3.1
PATCH 93/622 lnet: set health value from user space
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Collect debugging information for ioctl setting manually health value. Test if a peer is returned by lnet_find_peer_ni_locked() when lnet_get_peer_info() is called. This was discovered when the user land tools were updated for setting the health value.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: c0ad398fd716 ("LU-9120 lnet: set health value from user space")
Reviewed-on: https://review.whamcloud.com/32863
--- net/lnet/lnet/api-ni.c | 6 ++++++ net/lnet/lnet/peer.c | 4 ++++ 2 files changed, 10 insertions(+)
net/lnet/lnet/api-ni.c +6 -0
@@ -3526,6 +3526,12 @@ u32 lnet_get_dlc_seq_locked(void) value =LNET_MAX_HEALTH_VALUE ; else value = cfg->rh_value; +CDEBUG (D_NET , +"Manually setting healthv to %d for %s:%s. all = %d\n" , + value, + (cfg->rh_type ==LNET_HEALTH_TYPE_LOCAL_NI ) ? +"local" :"peer" , +libcfs_nid2str (cfg->rh_nid), cfg->rh_all);mutex_lock (&the_lnet.ln_api_mutex);if (cfg->rh_type ==LNET_HEALTH_TYPE_LOCAL_NI ) lnet_ni_set_healthv(cfg->rh_nid, value,
net/lnet/lnet/peer.c +4 -0
@@ -3484,6 +3484,10 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk)if (!all) {lnet_net_lock (LNET_LOCK_EX ); lpni =lnet_find_peer_ni_locked (nid); +if (!lpni) { +lnet_net_unlock (LNET_LOCK_EX ); +return ; + }atomic_set (&lpni->lpni_healthv, value);lnet_peer_ni_add_to_recoveryq_locked (lpni);lnet_peer_ni_decref_locked (lpni);
Signature · 1 line
1.8.3.1
PATCH 94/622 lnet: add global health statistics
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Added global health statistics
Print that from lnetctl.
lnetctl stats show
lnet_selftest passes the statistics block over the wire. This, unfortunately, creates an unnecessary backwards compatibility link for lnet_selftest, which shouldn't be there. This patch breaks this backwards compatibility, which means lnet_selftest will not work with older selftest modules.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 15020fd977af ("LU-9120 lnet: add global health statistics")
Reviewed-on: https://review.whamcloud.com/32949
--- include/linux/lnet/lib-lnet.h | 2 ++ include/uapi/linux/lnet/lnet-types.h | 13 +++++++++++++ net/lnet/lnet/api-ni.c | 13 +++++++++++++ net/lnet/lnet/lib-move.c | 11 +++++++++++ net/lnet/lnet/lib-msg.c | 28 +++++++++++++++++++++++----- 5 files changed, 62 insertions(+), 5 deletions(-)
include/linux/lnet/lib-lnet.h +2 -0
@@ -445,6 +445,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec, rspt =kzalloc (sizeof (*rspt),GFP_NOFS );lnet_net_lock (cpt); + the_lnet.ln_counters[cpt]->rst_alloc++;lnet_net_unlock (cpt);return rspt; }
@@ -454,6 +455,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec, {kfree (rspt);lnet_net_lock (cpt); + the_lnet.ln_counters[cpt]->rst_alloc--;lnet_net_unlock (cpt); }
include/uapi/linux/lnet/lnet-types.h +13 -0
@@ -278,11 +278,24 @@ struct lnet_ping_info {struct lnet_counters {__u32 msgs_alloc;__u32 msgs_max; +__u32 rst_alloc;__u32 errors;__u32 send_count;__u32 recv_count;__u32 route_count;__u32 drop_count; +__u32 resend_count; +__u32 response_timeout_count; +__u32 local_interrupt_count; +__u32 local_dropped_count; +__u32 local_aborted_count; +__u32 local_no_route_count; +__u32 local_timeout_count; +__u32 local_error_count; +__u32 remote_dropped_count; +__u32 remote_error_count; +__u32 remote_timeout_count; +__u32 network_timeout_count;__u64 send_length;__u64 recv_length;__u64 route_length;
net/lnet/lnet/api-ni.c +13 -0
@@ -694,7 +694,20 @@ static void lnet_assert_wire_constants(void)cfs_percpt_for_each (ctr, i, the_lnet.ln_counters) { counters->msgs_max += ctr->msgs_max; counters->msgs_alloc += ctr->msgs_alloc; + counters->rst_alloc += ctr->rst_alloc; counters->errors += ctr->errors; + counters->resend_count += ctr->resend_count; + counters->response_timeout_count += ctr->response_timeout_count; + counters->local_interrupt_count += ctr->local_interrupt_count; + counters->local_dropped_count += ctr->local_dropped_count; + counters->local_aborted_count += ctr->local_aborted_count; + counters->local_no_route_count += ctr->local_no_route_count; + counters->local_timeout_count += ctr->local_timeout_count; + counters->local_error_count += ctr->local_error_count; + counters->remote_dropped_count += ctr->remote_dropped_count; + counters->remote_error_count += ctr->remote_error_count; + counters->remote_timeout_count += ctr->remote_timeout_count; + counters->network_timeout_count += ctr->network_timeout_count; counters->send_count += ctr->send_count; counters->recv_count += ctr->recv_count; counters->route_count += ctr->route_count;
net/lnet/lnet/lib-move.c +11 -0
@@ -2501,6 +2501,10 @@ struct lnet_mt_event_info { md->md_rspt_ptr =NULL ;lnet_res_unlock (i); +lnet_net_lock (i); + the_lnet.ln_counters[i]->response_timeout_count++; +lnet_net_unlock (i); +list_del_init (&rspt->rspt_on_list); CDEBUG(D_NET,
@@ -2567,6 +2571,11 @@ struct lnet_mt_event_info {lnet_peer_ni_decref_locked (lpni);lnet_net_unlock (cpt); +CDEBUG (D_NET ,"resending %s->%s: %s recovery %d\n" , +libcfs_nid2str (src_nid), +libcfs_id2str (msg->msg_target), +lnet_msgtyp2str (msg->msg_type), + msg->msg_recovery); rc =lnet_send (src_nid, msg,LNET_NID_ANY );if (rc) { CERROR("Error sending %s to %s: %d\n",
@@ -2576,6 +2585,8 @@ struct lnet_mt_event_info {lnet_finalize (msg, rc); }lnet_net_lock (cpt); +if (!rc) + the_lnet.ln_counters[cpt]->resend_count++; } } }
net/lnet/lnet/lib-msg.c +23 -5
@@ -546,41 +546,52 @@ {struct lnet_ni *ni = msg->msg_txni;struct lnet_peer_ni *lpni = msg->msg_txpeer; +struct lnet_counters *counters = the_lnet.ln_counters[0 ];switch (hstatus) {case LNET_MSG_STATUS_LOCAL_INTERRUPT :atomic_inc (&ni->ni_hstats.hlt_local_interrupt); + counters->local_interrupt_count++;break ;case LNET_MSG_STATUS_LOCAL_DROPPED :atomic_inc (&ni->ni_hstats.hlt_local_dropped); + counters->local_dropped_count++;break ;case LNET_MSG_STATUS_LOCAL_ABORTED :atomic_inc (&ni->ni_hstats.hlt_local_aborted); + counters->local_aborted_count++;break ;case LNET_MSG_STATUS_LOCAL_NO_ROUTE :atomic_inc (&ni->ni_hstats.hlt_local_no_route); + counters->local_no_route_count++;break ;case LNET_MSG_STATUS_LOCAL_TIMEOUT :atomic_inc (&ni->ni_hstats.hlt_local_timeout); + counters->local_timeout_count++;break ;case LNET_MSG_STATUS_LOCAL_ERROR :atomic_inc (&ni->ni_hstats.hlt_local_error); + counters->local_error_count++;break ;case LNET_MSG_STATUS_REMOTE_DROPPED :if (lpni)atomic_inc (&lpni->lpni_hstats.hlt_remote_dropped); + counters->remote_dropped_count++;break ;case LNET_MSG_STATUS_REMOTE_ERROR :if (lpni)atomic_inc (&lpni->lpni_hstats.hlt_remote_error); + counters->remote_error_count++;break ;case LNET_MSG_STATUS_REMOTE_TIMEOUT :if (lpni)atomic_inc (&lpni->lpni_hstats.hlt_remote_timeout); + counters->remote_timeout_count++;break ;case LNET_MSG_STATUS_NETWORK_TIMEOUT :if (lpni)atomic_inc (&lpni->lpni_hstats.hlt_network_timeout); + counters->network_timeout_count++;break ;case LNET_MSG_STATUS_OK :break ;
@@ -601,6 +612,10 @@enum lnet_msg_hstatus hstatus = msg->msg_health_status;bool lo = false; +/* if we're shutting down no point in handling health. */ +if (the_lnet.ln_state !=LNET_STATE_RUNNING ) +return -1 ; +LASSERT (msg->msg_txni);/* if we're sending to the LOLND then the msg_txpeer will not be
@@ -611,15 +626,18 @@else lo = true; -lnet_incr_hstats (msg, hstatus); -if (hstatus !=LNET_MSG_STATUS_OK &&ktime_compare (ktime_get (), msg->msg_deadline) >=0 )return -1 ; -/* if we're shutting down no point in handling health. */ -if (the_lnet.ln_state !=LNET_STATE_RUNNING ) -return -1 ; +/* stats are only incremented for errors so avoid wasting time +* incrementing statistics if there is no error. +*/ +if (hstatus !=LNET_MSG_STATUS_OK ) { +lnet_net_lock (0 ); +lnet_incr_hstats (msg, hstatus); +lnet_net_unlock (0 ); + } CDEBUG(D_NET, "health check: %s->%s: %s: %s\n", libcfs_nid2str(msg->msg_txni->ni_nid),
Signature · 1 line
1.8.3.1
PATCH 95/622 lnet: print recovery queues content
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add commands to lnetctl to print recovery queues content from user space.
Associated code to handle the IOCTL added in LNet module.
for local NIs:
lnetctl debug recovery --local
for peer NIs:
lnetctl debug recovery --peer
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 826ea19c077b ("LU-9120 lnet: print recovery queues content")
Reviewed-on: https://review.whamcloud.com/32950
--- include/uapi/linux/lnet/libcfs_ioctl.h | 3 +- include/uapi/linux/lnet/lnet-dlc.h | 8 +++++ net/lnet/lnet/api-ni.c | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-)
include/uapi/linux/lnet/libcfs_ioctl.h +2 -1
@@ -150,6 +150,7 @@ struct libcfs_debug_ioctl_data {#define IOC_LIBCFS_GET_LOCAL_NI_MSG_STATS _IOWR(IOC_LIBCFS_TYPE, 101, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_SET_HEALHV _IOWR(IOC_LIBCFS_TYPE, 102, IOCTL_CONFIG_SIZE)#define IOC_LIBCFS_GET_LOCAL_HSTATS _IOWR(IOC_LIBCFS_TYPE, 103, IOCTL_CONFIG_SIZE) -#define IOC_LIBCFS_MAX_NR 103 +#define IOC_LIBCFS_GET_RECOVERY_QUEUE _IOWR(IOC_LIBCFS_TYPE, 104, IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_MAX_NR 104#endif /* __LIBCFS_IOCTL_H__ */
include/uapi/linux/lnet/lnet-dlc.h +8 -0
@@ -35,6 +35,7 @@#define MAX_NUM_SHOW_ENTRIES 32#define LNET_MAX_STR_LEN 128#define LNET_MAX_SHOW_NUM_CPT 128 +#define LNET_MAX_SHOW_NUM_NID 128#define LNET_UNDEFINED_HOPS ((__u32)(-1))/*
@@ -263,6 +264,13 @@ struct lnet_ioctl_reset_health_cfg {lnet_nid_t rh_nid; }; +struct lnet_ioctl_recovery_list { +struct libcfs_ioctl_hdr rlst_hdr; +enum lnet_health_type rlst_type; +int rlst_num_nids; +lnet_nid_t rlst_nid_array[LNET_MAX_SHOW_NUM_NID ]; +}; +struct lnet_ioctl_set_value {struct libcfs_ioctl_hdr sv_hdr;__u32 sv_value;
net/lnet/lnet/api-ni.c +53 -0
65 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 96/622 lnet: health error simulation
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Modified the error simulation code to simulate health errors for testing purposes. The specific error can be set. If multiple errors are configured then one at random is chosen from the set.
EX:
lctl net_drop_add -s *@tcp -d *@tcp -m GET -i 1 -e local_interrupt
The -e can be repeated multiple times to specify different errors to simulate. The available set are
local_interrupt
local_dropped
local_aborted
local_no_route
local_error
local_timeout
remote_error
remote_dropped
remote_timeout
network_timeout
random
a -n, "--random", has been added to randomize error generation for drop rules. This will rely an interval value provided via -i. This will generate a random number no bigger than interval. If the number is smaller than half of the interval then the rule isn't matched, otherwise it is.
The purpose of this is because drop matching can happen multiple times in the path of sending the message, and using time based or rate will not result in even error generation across the multiple calls.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9120
Lustre-commit: 5c17777d97bd ("LU-9120 lnet: health error simulation")
Reviewed-on: https://review.whamcloud.com/32951
--- include/linux/lnet/lib-lnet.h | 4 +- include/linux/lnet/lib-types.h | 3 +- include/uapi/linux/lnet/lnetctl.h | 17 +++++++++ net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 6 ++- net/lnet/klnds/socklnd/socklnd_cb.c | 27 ++++++++++---- net/lnet/lnet/lib-move.c | 2 +- net/lnet/lnet/lib-msg.c | 24 ++++++++++++ net/lnet/lnet/net_fault.c | 73 ++++++++++++++++++++++++++++++++++--- 8 files changed, 138 insertions(+), 18 deletions(-)
include/linux/lnet/lib-lnet.h +3 -1
@@ -639,6 +639,8 @@ void lnet_set_reply_msg_len(struct lnet_ni *ni, struct lnet_msg *msg,void lnet_detach_rsp_tracker (struct lnet_libmd *md,int cpt);void lnet_finalize (struct lnet_msg *msg,int rc); +bool lnet_send_error_simulation (struct lnet_msg *msg, +enum lnet_msg_hstatus *hstatus);void lnet_drop_message (struct lnet_ni *ni,int cpt,void *private,unsigned int nob,u32 msg_type);
@@ -661,7 +663,7 @@ void lnet_drop_message(struct lnet_ni *ni, int cpt, void *private,int lnet_fault_init (void );void lnet_fault_fini (void ); -bool lnet_drop_rule_match (struct lnet_hdr *hdr); +bool lnet_drop_rule_match (struct lnet_hdr *hdr,enum lnet_msg_hstatus *hstatus);int lnet_delay_rule_add (struct lnet_fault_attr *attr);int lnet_delay_rule_del (lnet_nid_t src,lnet_nid_t dst,bool shutdown);
include/linux/lnet/lib-types.h +2 -1
@@ -72,7 +72,8 @@ enum lnet_msg_hstatus {LNET_MSG_STATUS_REMOTE_ERROR ,LNET_MSG_STATUS_REMOTE_DROPPED ,LNET_MSG_STATUS_REMOTE_TIMEOUT , -LNET_MSG_STATUS_NETWORK_TIMEOUT +LNET_MSG_STATUS_NETWORK_TIMEOUT , + LNET_MSG_STATUS_END, }; struct lnet_rsp_tracker {
include/uapi/linux/lnet/lnetctl.h +17 -0
@@ -41,6 +41,19 @@ enum {#define LNET_GET_BIT (1 << 2)#define LNET_REPLY_BIT (1 << 3) +#define HSTATUS_END 11 +#define HSTATUS_LOCAL_INTERRUPT_BIT (1 << 1) +#define HSTATUS_LOCAL_DROPPED_BIT (1 << 2) +#define HSTATUS_LOCAL_ABORTED_BIT (1 << 3) +#define HSTATUS_LOCAL_NO_ROUTE_BIT (1 << 4) +#define HSTATUS_LOCAL_ERROR_BIT (1 << 5) +#define HSTATUS_LOCAL_TIMEOUT_BIT (1 << 6) +#define HSTATUS_REMOTE_ERROR_BIT (1 << 7) +#define HSTATUS_REMOTE_DROPPED_BIT (1 << 8) +#define HSTATUS_REMOTE_TIMEOUT_BIT (1 << 9) +#define HSTATUS_NETWORK_TIMEOUT_BIT (1 << 10) +#define HSTATUS_RANDOM 0xffffffff +/** ioctl parameter for LNet fault simulation */ struct lnet_fault_attr {/**
@@ -78,6 +91,10 @@ struct lnet_fault_attr {* with da_rate */ __u32 da_interval; +/** error type mask */ +__u32 da_health_error_mask; +/** randomize error generation */ +bool da_random; } drop;/** message latency simulation */ struct {
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +5 -1
@@ -912,7 +912,11 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx, bad->wr_id, bad->opcode, bad->send_flags, libcfs_nid2str(conn->ibc_peer->ibp_nid)); bad =NULL ; - rc =ib_post_send (conn->ibc_cmid->qp, wrq, &bad); +if (lnet_send_error_simulation (tx->tx_lntmsg[0 ], + &tx->tx_hstatus)) + rc = -EINVAL ; +else + rc =ib_post_send (conn->ibc_cmid->qp, wrq, &bad); } conn->ibc_last_send =ktime_get ();
net/lnet/klnds/socklnd/socklnd_cb.c +19 -8
@@ -335,7 +335,8 @@ struct ksock_tx *if (!rc && (tx->tx_resid !=0 || tx->tx_zc_aborted)) { rc = -EIO ; - hstatus =LNET_MSG_STATUS_LOCAL_ERROR ; +if (hstatus ==LNET_MSG_STATUS_OK ) + hstatus =LNET_MSG_STATUS_LOCAL_ERROR ; }if (tx->tx_conn)
@@ -467,6 +468,13 @@ struct ksock_tx * ksocknal_process_transmit(struct ksock_conn *conn, struct ksock_tx *tx) { int rc; +bool error_sim = false; + +if (lnet_send_error_simulation (tx->tx_lnetmsg, &tx->tx_hstatus)) { + error_sim = true; + rc = -EINVAL ; + goto simulate_error; + }if (tx->tx_zc_capable && !tx->tx_zc_checked)ksocknal_check_zc_req (tx);
@@ -512,16 +520,19 @@ struct ksock_tx *return rc; } +simulate_error:/* Actual error */ LASSERT (rc <0 ); -/* set the health status of the message which determines -* whether we should retry the transmit -*/ -if (rc == -ETIMEDOUT ) - tx->tx_hstatus =LNET_MSG_STATUS_REMOTE_TIMEOUT ; -else - tx->tx_hstatus =LNET_MSG_STATUS_LOCAL_ERROR ; +if (!error_sim) { +/* set the health status of the message which determines +* whether we should retry the transmit +*/ +if (rc == -ETIMEDOUT ) + tx->tx_hstatus =LNET_MSG_STATUS_REMOTE_TIMEOUT ; +else + tx->tx_hstatus =LNET_MSG_STATUS_LOCAL_ERROR ; + }if (!conn->ksnc_closing) {switch (rc) {
net/lnet/lnet/lib-move.c +1 -1
@@ -3875,7 +3875,7 @@ void lnet_monitor_thr_stop(void) }if (!list_empty (&the_lnet.ln_drop_rules) && -lnet_drop_rule_match (hdr)) { +lnet_drop_rule_match (hdr,NULL )) {CDEBUG (D_NET ,"%s, src %s, dst %s: Dropping %s to simulate silent message loss\n" ,libcfs_nid2str (from_nid),libcfs_nid2str (src_nid),libcfs_nid2str (dest_nid),lnet_msgtyp2str (type));
net/lnet/lnet/lib-msg.c +24 -0
@@ -812,6 +812,30 @@ } } +bool +lnet_send_error_simulation (struct lnet_msg *msg, +enum lnet_msg_hstatus *hstatus) +{ +if (!msg) +return false; + +if (list_empty (&the_lnet.ln_drop_rules)) +return false; + +/* match only health rules */ +if (!lnet_drop_rule_match (&msg->msg_hdr, hstatus)) +return false; + +CDEBUG (D_NET ,"src %s, dst %s: %s simulate health error: %s\n" , +libcfs_nid2str (msg->msg_hdr.src_nid), +libcfs_nid2str (msg->msg_hdr.dest_nid), +lnet_msgtyp2str (msg->msg_type), +lnet_health_error2str (*hstatus)); + +return true; +} +EXPORT_SYMBOL (lnet_send_error_simulation); +void lnet_finalize (struct lnet_msg *msg,int status) {
net/lnet/lnet/net_fault.c +67 -6
119 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 97/622 lustre: ptlrpc: replace simple_strtol with kstrtol
In reply to James SimmonsEventually simple_strtol() will be removed so replace its use in the ptlrpc with kstrtoXXX() class of functions.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9325
Lustre-commit: 8f37d64b6bc9 ("LU-9325 ptlrpc: replace simple_strtol with kstrtol")
Reviewed-on: https://review.whamcloud.com/32785
--- fs/lustre/ptlrpc/lproc_ptlrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/lustre/ptlrpc/lproc_ptlrpc.c +3 -3
@@ -1303,13 +1303,13 @@ int lprocfs_wr_import(struct file *file, const char __user *buffer, ptr =strstr (uuid,"::" );if (ptr) {u32 inst; -char *endptr; +int rc; *ptr =0 ; do_reconn =0 ; ptr +=strlen ("::" ); - inst =simple_strtoul (ptr, &endptr,10 ); -if (*endptr) { + rc =kstrtouint (ptr,10 , &inst); +if (rc) {CERROR ("config: wrong instance # %s\n" , ptr); }else if (inst != imp->imp_connect_data.ocd_instance) { CDEBUG(D_INFO,
Signature · 1 line
1.8.3.1
PATCH 98/622 lustre: obd: use correct ip_compute_csum() version
In reply to James SimmonsThe linux kernel provides a generic platform independent version of ip_compute_csum() as well as platform optimized versions. Some platforms will disable the generic platform version in favor of the optimized one. If the generic version is disabled and if the checksum.h header from asm-generic is used then we will end up with a undefined symbol error when loading the obdclass module. The solution is to use the platform specific checksum.h header that will handle using the generic or optimized version for us. As a bounus we get better performance with the right kernel configuration.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11224
Lustre-commit: 82fe90a1d07d ("LU-11224 obd: use correct ip_compute_csum() version")
Reviewed-on: https://review.whamcloud.com/32953
--- fs/lustre/obdclass/integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lustre/obdclass/integrity.c +1 -1
@@ -28,7 +28,7 @@*/ #include <linux/blkdev.h> #include <linux/crc-t10dif.h> -#include <asm-generic/checksum.h> +#include <asm/checksum.h> #include <obd_class.h> #include <obd_cksum.h>
Signature · 1 line
1.8.3.1