From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC] writeback: add elastic bdi in cgwb bdp
Date: Mon, 14 Oct 2019 04:13:44 +0800 [thread overview]
Message-ID: <201910140407.IjNW59uK%lkp@intel.com> (raw)
In-Reply-To: <20191012132740.12968-1-hdanton@sina.com>
[-- Attachment #1: Type: text/plain, Size: 7896 bytes --]
Hi Hillf,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc2 next-20191011]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Hillf-Danton/writeback-add-elastic-bdi-in-cgwb-bdp/20191014-014906
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
fs/fs-writeback.c: In function 'wbc_detach_inode':
>> fs/fs-writeback.c:637:27: error: 'struct bdi_writeback' has no member named 'bdp_waitq'
if (waitqueue_active(&wb->bdp_waitq))
^~
In file included from include/linux/mmzone.h:10:0,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from fs/fs-writeback.c:20:
fs/fs-writeback.c:638:19: error: 'struct bdi_writeback' has no member named 'bdp_waitq'
wake_up_all(&wb->bdp_waitq);
^
include/linux/wait.h:210:36: note: in definition of macro 'wake_up_all'
#define wake_up_all(x) __wake_up(x, TASK_NORMAL, 0, NULL)
^
vim +637 fs/fs-writeback.c
586
587 /**
588 * wbc_detach_inode - disassociate wbc from inode and perform foreign detection
589 * @wbc: writeback_control of the just finished writeback
590 *
591 * To be called after a writeback attempt of an inode finishes and undoes
592 * wbc_attach_and_unlock_inode(). Can be called under any context.
593 *
594 * As concurrent write sharing of an inode is expected to be very rare and
595 * memcg only tracks page ownership on first-use basis severely confining
596 * the usefulness of such sharing, cgroup writeback tracks ownership
597 * per-inode. While the support for concurrent write sharing of an inode
598 * is deemed unnecessary, an inode being written to by different cgroups at
599 * different points in time is a lot more common, and, more importantly,
600 * charging only by first-use can too readily lead to grossly incorrect
601 * behaviors (single foreign page can lead to gigabytes of writeback to be
602 * incorrectly attributed).
603 *
604 * To resolve this issue, cgroup writeback detects the majority dirtier of
605 * an inode and transfers the ownership to it. To avoid unnnecessary
606 * oscillation, the detection mechanism keeps track of history and gives
607 * out the switch verdict only if the foreign usage pattern is stable over
608 * a certain amount of time and/or writeback attempts.
609 *
610 * On each writeback attempt, @wbc tries to detect the majority writer
611 * using Boyer-Moore majority vote algorithm. In addition to the byte
612 * count from the majority voting, it also counts the bytes written for the
613 * current wb and the last round's winner wb (max of last round's current
614 * wb, the winner from two rounds ago, and the last round's majority
615 * candidate). Keeping track of the historical winner helps the algorithm
616 * to semi-reliably detect the most active writer even when it's not the
617 * absolute majority.
618 *
619 * Once the winner of the round is determined, whether the winner is
620 * foreign or not and how much IO time the round consumed is recorded in
621 * inode->i_wb_frn_history. If the amount of recorded foreign IO time is
622 * over a certain threshold, the switch verdict is given.
623 */
624 void wbc_detach_inode(struct writeback_control *wbc)
625 {
626 struct bdi_writeback *wb = wbc->wb;
627 struct inode *inode = wbc->inode;
628 unsigned long avg_time, max_bytes, max_time;
629 u16 history;
630 int max_id;
631
632 if (!wb)
633 return;
634
635 if (IS_ENABLED(CONFIG_CGROUP_WRITEBACK) &&
636 IS_ENABLED(CONFIG_CGWB_BDP_WITH_EBDI))
> 637 if (waitqueue_active(&wb->bdp_waitq))
638 wake_up_all(&wb->bdp_waitq);
639
640 history = inode->i_wb_frn_history;
641 avg_time = inode->i_wb_frn_avg_time;
642
643 /* pick the winner of this round */
644 if (wbc->wb_bytes >= wbc->wb_lcand_bytes &&
645 wbc->wb_bytes >= wbc->wb_tcand_bytes) {
646 max_id = wbc->wb_id;
647 max_bytes = wbc->wb_bytes;
648 } else if (wbc->wb_lcand_bytes >= wbc->wb_tcand_bytes) {
649 max_id = wbc->wb_lcand_id;
650 max_bytes = wbc->wb_lcand_bytes;
651 } else {
652 max_id = wbc->wb_tcand_id;
653 max_bytes = wbc->wb_tcand_bytes;
654 }
655
656 /*
657 * Calculate the amount of IO time the winner consumed and fold it
658 * into the running average kept per inode. If the consumed IO
659 * time is lower than avag / WB_FRN_TIME_CUT_DIV, ignore it for
660 * deciding whether to switch or not. This is to prevent one-off
661 * small dirtiers from skewing the verdict.
662 */
663 max_time = DIV_ROUND_UP((max_bytes >> PAGE_SHIFT) << WB_FRN_TIME_SHIFT,
664 wb->avg_write_bandwidth);
665 if (avg_time)
666 avg_time += (max_time >> WB_FRN_TIME_AVG_SHIFT) -
667 (avg_time >> WB_FRN_TIME_AVG_SHIFT);
668 else
669 avg_time = max_time; /* immediate catch up on first run */
670
671 if (max_time >= avg_time / WB_FRN_TIME_CUT_DIV) {
672 int slots;
673
674 /*
675 * The switch verdict is reached if foreign wb's consume
676 * more than a certain proportion of IO time in a
677 * WB_FRN_TIME_PERIOD. This is loosely tracked by 16 slot
678 * history mask where each bit represents one sixteenth of
679 * the period. Determine the number of slots to shift into
680 * history from @max_time.
681 */
682 slots = min(DIV_ROUND_UP(max_time, WB_FRN_HIST_UNIT),
683 (unsigned long)WB_FRN_HIST_MAX_SLOTS);
684 history <<= slots;
685 if (wbc->wb_id != max_id)
686 history |= (1U << slots) - 1;
687
688 if (history)
689 trace_inode_foreign_history(inode, wbc, history);
690
691 /*
692 * Switch if the current wb isn't the consistent winner.
693 * If there are multiple closely competing dirtiers, the
694 * inode may switch across them repeatedly over time, which
695 * is okay. The main goal is avoiding keeping an inode on
696 * the wrong wb for an extended period of time.
697 */
698 if (hweight32(history) > WB_FRN_HIST_THR_SLOTS)
699 inode_switch_wbs(inode, max_id);
700 }
701
702 /*
703 * Multiple instances of this function may race to update the
704 * following fields but we don't mind occassional inaccuracies.
705 */
706 inode->i_wb_frn_winner = max_id;
707 inode->i_wb_frn_avg_time = min(avg_time, (unsigned long)U16_MAX);
708 inode->i_wb_frn_history = history;
709
710 wb_put(wbc->wb);
711 wbc->wb = NULL;
712 }
713 EXPORT_SYMBOL_GPL(wbc_detach_inode);
714
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 52219 bytes --]
next prev parent reply other threads:[~2019-10-13 20:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-12 13:27 [RFC] writeback: add elastic bdi in cgwb bdp Hillf Danton
2019-10-13 19:17 ` kbuild test robot
2019-10-13 20:13 ` kbuild test robot [this message]
2019-10-15 10:22 ` Jan Kara
2019-10-15 14:03 ` Hillf Danton
2019-10-15 14:37 ` Tejun Heo
2019-10-16 2:26 ` Hillf Danton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201910140407.IjNW59uK%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.