#define log2(n) ffz(~(n))
#endif
+/**
+ * If there is only one number of core visible to Lustre,
+ * async readahead will be disabled, to avoid massive over
+ * subscription, we use 1/2 of active cores as default max
+ * async readahead requests.
+ */
+static inline unsigned int ll_get_ra_async_max_active(void)
+{
+ return cfs_cpt_weight(cfs_cpt_tab, CFS_CPT_ANY) >> 1;
+}
+
static struct ll_sb_info *ll_init_sbi(void)
{
struct ll_sb_info *sbi = NULL;
GOTO(out_destroy_ra, rc = -ENOMEM);
sbi->ll_ra_info.ra_max_pages_per_file = min(pages / 32,
- SBI_DEFAULT_READAHEAD_MAX);
+ SBI_DEFAULT_READ_AHEAD_MAX);
sbi->ll_ra_info.ra_async_pages_per_file_threshold =
sbi->ll_ra_info.ra_max_pages_per_file;
sbi->ll_ra_info.ra_max_pages = sbi->ll_ra_info.ra_max_pages_per_file;
sbi->ll_ra_info.ra_max_read_ahead_whole_pages = -1;
+ sbi->ll_ra_info.ra_async_max_active = ll_get_ra_async_max_active();
+ atomic_set(&sbi->ll_ra_info.ra_async_inflight, 0);
sbi->ll_flags |= LL_SBI_VERBOSE;
#ifdef ENABLE_CHECKSUM
OBD_CONNECT2_INC_XID |
OBD_CONNECT2_LSOM |
OBD_CONNECT2_ASYNC_DISCARD |
- OBD_CONNECT2_PCC;
+ OBD_CONNECT2_PCC |
+ OBD_CONNECT2_CRUSH;
#ifdef HAVE_LRU_RESIZE_SUPPORT
if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK |
OBD_CONNECT_BULK_MBITS | OBD_CONNECT_SHORTIO |
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 released prior
- * to landing in master. This support will be dropped when 2.13 development
- * starts. At the point, we should not just drop the connect flag (below), we
- * should also remove the support in the code.
- *
- * Removing it means a few things:
- * 1. Remove this section here
- * 2. Remove CEF_NONBLOCK in ll_file_lockahead()
- * 3. Remove function exp_connect_lockahead_old
- * 4. Remove LDLM_FL_LOCKAHEAD_OLD_RESERVED in lustre_dlm_flags.h
- * */
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 50, 0)
- data->ocd_connect_flags |= OBD_CONNECT_LOCKAHEAD_OLD;
-#endif
-
data->ocd_connect_flags2 = OBD_CONNECT2_LOCKAHEAD |
OBD_CONNECT2_INC_XID;
/* 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,
+ max_t(unsigned long, SBI_DEFAULT_READ_AHEAD_WHOLE_MAX,
(data->ocd_brw_size >> PAGE_SHIFT));
if (sbi->ll_ra_info.ra_max_read_ahead_whole_pages >
sbi->ll_ra_info.ra_max_pages_per_file)
sb->s_dev = sbi->ll_sdev_orig;
/* wait running statahead threads to quit */
- while (atomic_read(&sbi->ll_sa_running) > 0) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(1) >> 3);
- }
+ while (atomic_read(&sbi->ll_sa_running) > 0)
+ schedule_timeout_uninterruptible(
+ cfs_time_seconds(1) >> 3);
}
EXIT;
/* Wait for unstable pages to be committed to stable storage */
if (force == 0) {
- struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL);
- rc = l_wait_event(sbi->ll_cache->ccc_unstable_waitq,
- atomic_long_read(&sbi->ll_cache->ccc_unstable_nr) == 0,
- &lwi);
+ rc = l_wait_event_abortable(
+ sbi->ll_cache->ccc_unstable_waitq,
+ atomic_long_read(&sbi->ll_cache->ccc_unstable_nr) == 0);
}
ccc_count = atomic_long_read(&sbi->ll_cache->ccc_unstable_nr);
- if (force == 0 && rc != -EINTR)
+ if (force == 0 && rc != -ERESTARTSYS)
LASSERTF(ccc_count == 0, "count: %li\n", ccc_count);
/* We need to set force before the lov_disconnect in
(s64)attr->ia_mtime.tv_sec, (s64)attr->ia_ctime.tv_sec,
ktime_get_real_seconds());
- if (S_ISREG(inode->i_mode)) {
- if (attr->ia_valid & ATTR_SIZE)
- inode_dio_write_done(inode);
+ if (S_ISREG(inode->i_mode))
inode_unlock(inode);
- }
/* We always do an MDS RPC, even if we're only changing the size;
* only the MDS knows whether truncate() should fail with -ETXTBUSY */
}
if (attr->ia_valid & ATTR_FILE) {
- struct ll_file_data *fd = LUSTRE_FPRIVATE(attr->ia_file);
+ struct ll_file_data *fd = attr->ia_file->private_data;
if (fd->fd_lease_och)
op_data->op_bias |= MDS_TRUNC_KEEP_LEASE;
OBD_FREE_PTR(op_data);
}
-#ifdef HAVE_SUPEROPS_USE_DENTRY
int ll_show_options(struct seq_file *seq, struct dentry *dentry)
-#else
-int ll_show_options(struct seq_file *seq, struct vfsmount *vfs)
-#endif
{
struct ll_sb_info *sbi;
-#ifdef HAVE_SUPEROPS_USE_DENTRY
- LASSERT((seq != NULL) && (dentry != NULL));
+ LASSERT(seq && dentry);
sbi = ll_s2sbi(dentry->d_sb);
-#else
- LASSERT((seq != NULL) && (vfs != NULL));
- sbi = ll_s2sbi(vfs->mnt_sb);
-#endif
if (sbi->ll_flags & LL_SBI_NOLCK)
seq_puts(seq, ",nolock");