tree:
https://github.com/intel/linux-intel-lts.git 4.19/preempt-rt
head: fe555b433eaef9bf08a98a527ed26759607a7879
commit: 7cf6c733c0aa7108e00a2ae809e3d2261a86a703 [5/18] Merge tag
'lts-v4.19.120-base-200512T132121Z' into lts2018/preempt-rt
config: x86_64-randconfig-a004-20210521 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
e84a9b9bb3051c35dea993cdad7b3d2575638f85)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://github.com/intel/linux-intel-lts/commit/7cf6c733c0aa7108e00a2ae80...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/preempt-rt
git checkout 7cf6c733c0aa7108e00a2ae809e3d2261a86a703
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> mm/zswap.c:995:30: warning: unused variable
'zswap_dstmem_lock' [-Wunused-const-variable]
static
DEFINE_LOCAL_IRQ_LOCK(zswap_dstmem_lock);
^
1 warning generated.
vim +/zswap_dstmem_lock +995 mm/zswap.c
a85f878b443f8d2 Srividya Desireddy 2018-01-31 993
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 994 /* protect zswap_dstmem from
concurrency */
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 @995 static
DEFINE_LOCAL_IRQ_LOCK(zswap_dstmem_lock);
2b2811178e85553 Seth Jennings 2013-07-10 996
/*********************************
2b2811178e85553 Seth Jennings 2013-07-10 997 * frontswap hooks
2b2811178e85553 Seth Jennings 2013-07-10 998
**********************************/
2b2811178e85553 Seth Jennings 2013-07-10 999 /* attempts to compress and
store an single page */
2b2811178e85553 Seth Jennings 2013-07-10 1000 static int
zswap_frontswap_store(unsigned type, pgoff_t offset,
2b2811178e85553 Seth Jennings 2013-07-10 1001 struct page *page)
2b2811178e85553 Seth Jennings 2013-07-10 1002 {
2b2811178e85553 Seth Jennings 2013-07-10 1003 struct zswap_tree *tree =
zswap_trees[type];
2b2811178e85553 Seth Jennings 2013-07-10 1004 struct zswap_entry *entry,
*dupentry;
f1c54846ee4504d Dan Streetman 2015-09-09 1005 struct crypto_comp *tfm;
2b2811178e85553 Seth Jennings 2013-07-10 1006 int ret;
9c3760eb80880f3 Yu Zhao 2018-01-31 1007 unsigned int hlen, dlen =
PAGE_SIZE;
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1008 unsigned long handle, value;
2b2811178e85553 Seth Jennings 2013-07-10 1009 char *buf;
2b2811178e85553 Seth Jennings 2013-07-10 1010 u8 *src, *dst;
9c3760eb80880f3 Yu Zhao 2018-01-31 1011 struct zswap_header zhdr = {
.swpentry = swp_entry(type, offset) };
2b2811178e85553 Seth Jennings 2013-07-10 1012
7ba716698cc53f8 Huang Ying 2018-02-21 1013 /* THP isn't supported
*/
7ba716698cc53f8 Huang Ying 2018-02-21 1014 if (PageTransHuge(page)) {
7ba716698cc53f8 Huang Ying 2018-02-21 1015 ret = -EINVAL;
7ba716698cc53f8 Huang Ying 2018-02-21 1016 goto reject;
7ba716698cc53f8 Huang Ying 2018-02-21 1017 }
7ba716698cc53f8 Huang Ying 2018-02-21 1018
c00ed16a9eb98a7 Dan Streetman 2015-06-25 1019 if (!zswap_enabled || !tree)
{
2b2811178e85553 Seth Jennings 2013-07-10 1020 ret = -ENODEV;
2b2811178e85553 Seth Jennings 2013-07-10 1021 goto reject;
2b2811178e85553 Seth Jennings 2013-07-10 1022 }
2b2811178e85553 Seth Jennings 2013-07-10 1023
2b2811178e85553 Seth Jennings 2013-07-10 1024 /* reclaim space if needed
*/
2b2811178e85553 Seth Jennings 2013-07-10 1025 if (zswap_is_full()) {
2b2811178e85553 Seth Jennings 2013-07-10 1026 zswap_pool_limit_hit++;
f1c54846ee4504d Dan Streetman 2015-09-09 1027 if (zswap_shrink()) {
2b2811178e85553 Seth Jennings 2013-07-10 1028
zswap_reject_reclaim_fail++;
2b2811178e85553 Seth Jennings 2013-07-10 1029 ret = -ENOMEM;
2b2811178e85553 Seth Jennings 2013-07-10 1030 goto reject;
2b2811178e85553 Seth Jennings 2013-07-10 1031 }
16e536ef47f5672 Li Wang 2018-07-26 1032
16e536ef47f5672 Li Wang 2018-07-26 1033 /* A second zswap_is_full()
check after
16e536ef47f5672 Li Wang 2018-07-26 1034 * zswap_shrink() to make
sure it's now
16e536ef47f5672 Li Wang 2018-07-26 1035 * under the
max_pool_percent
16e536ef47f5672 Li Wang 2018-07-26 1036 */
16e536ef47f5672 Li Wang 2018-07-26 1037 if (zswap_is_full()) {
16e536ef47f5672 Li Wang 2018-07-26 1038 ret = -ENOMEM;
16e536ef47f5672 Li Wang 2018-07-26 1039 goto reject;
16e536ef47f5672 Li Wang 2018-07-26 1040 }
2b2811178e85553 Seth Jennings 2013-07-10 1041 }
2b2811178e85553 Seth Jennings 2013-07-10 1042
2b2811178e85553 Seth Jennings 2013-07-10 1043 /* allocate entry */
2b2811178e85553 Seth Jennings 2013-07-10 1044 entry =
zswap_entry_cache_alloc(GFP_KERNEL);
2b2811178e85553 Seth Jennings 2013-07-10 1045 if (!entry) {
2b2811178e85553 Seth Jennings 2013-07-10 1046
zswap_reject_kmemcache_fail++;
2b2811178e85553 Seth Jennings 2013-07-10 1047 ret = -ENOMEM;
2b2811178e85553 Seth Jennings 2013-07-10 1048 goto reject;
2b2811178e85553 Seth Jennings 2013-07-10 1049 }
2b2811178e85553 Seth Jennings 2013-07-10 1050
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1051 if
(zswap_same_filled_pages_enabled) {
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1052 src = kmap_atomic(page);
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1053 if
(zswap_is_page_same_filled(src, &value)) {
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1054 kunmap_atomic(src);
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1055 entry->offset = offset;
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1056 entry->length = 0;
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1057 entry->value = value;
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1058
atomic_inc(&zswap_same_filled_pages);
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1059 goto insert_entry;
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1060 }
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1061 kunmap_atomic(src);
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1062 }
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1063
f1c54846ee4504d Dan Streetman 2015-09-09 1064 /* if entry is successfully
added, it keeps the reference */
f1c54846ee4504d Dan Streetman 2015-09-09 1065 entry->pool =
zswap_pool_current_get();
f1c54846ee4504d Dan Streetman 2015-09-09 1066 if (!entry->pool) {
f1c54846ee4504d Dan Streetman 2015-09-09 1067 ret = -EINVAL;
f1c54846ee4504d Dan Streetman 2015-09-09 1068 goto freepage;
f1c54846ee4504d Dan Streetman 2015-09-09 1069 }
f1c54846ee4504d Dan Streetman 2015-09-09 1070
2b2811178e85553 Seth Jennings 2013-07-10 1071 /* compress */
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 1072 dst =
get_locked_var(zswap_dstmem_lock, zswap_dstmem);
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 1073 tfm =
*this_cpu_ptr(entry->pool->tfm);
2b2811178e85553 Seth Jennings 2013-07-10 1074 src = kmap_atomic(page);
f1c54846ee4504d Dan Streetman 2015-09-09 1075 ret =
crypto_comp_compress(tfm, src, PAGE_SIZE, dst, &dlen);
2b2811178e85553 Seth Jennings 2013-07-10 1076 kunmap_atomic(src);
2b2811178e85553 Seth Jennings 2013-07-10 1077 if (ret) {
2b2811178e85553 Seth Jennings 2013-07-10 1078 ret = -EINVAL;
f1c54846ee4504d Dan Streetman 2015-09-09 1079 goto put_dstmem;
2b2811178e85553 Seth Jennings 2013-07-10 1080 }
2b2811178e85553 Seth Jennings 2013-07-10 1081
2b2811178e85553 Seth Jennings 2013-07-10 1082 /* store */
9c3760eb80880f3 Yu Zhao 2018-01-31 1083 hlen =
zpool_evictable(entry->pool->zpool) ? sizeof(zhdr) : 0;
9c3760eb80880f3 Yu Zhao 2018-01-31 1084 ret =
zpool_malloc(entry->pool->zpool, hlen + dlen,
d0164adc89f6bb3 Mel Gorman 2015-11-06 1085 __GFP_NORETRY |
__GFP_NOWARN | __GFP_KSWAPD_RECLAIM,
d0164adc89f6bb3 Mel Gorman 2015-11-06 1086 &handle);
2b2811178e85553 Seth Jennings 2013-07-10 1087 if (ret == -ENOSPC) {
2b2811178e85553 Seth Jennings 2013-07-10 1088
zswap_reject_compress_poor++;
f1c54846ee4504d Dan Streetman 2015-09-09 1089 goto put_dstmem;
2b2811178e85553 Seth Jennings 2013-07-10 1090 }
2b2811178e85553 Seth Jennings 2013-07-10 1091 if (ret) {
2b2811178e85553 Seth Jennings 2013-07-10 1092 zswap_reject_alloc_fail++;
f1c54846ee4504d Dan Streetman 2015-09-09 1093 goto put_dstmem;
2b2811178e85553 Seth Jennings 2013-07-10 1094 }
9c3760eb80880f3 Yu Zhao 2018-01-31 1095 buf =
zpool_map_handle(entry->pool->zpool, handle, ZPOOL_MM_RW);
9c3760eb80880f3 Yu Zhao 2018-01-31 1096 memcpy(buf, &zhdr,
hlen);
9c3760eb80880f3 Yu Zhao 2018-01-31 1097 memcpy(buf + hlen, dst,
dlen);
f1c54846ee4504d Dan Streetman 2015-09-09 1098
zpool_unmap_handle(entry->pool->zpool, handle);
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 1099
put_locked_var(zswap_dstmem_lock, zswap_dstmem);
2b2811178e85553 Seth Jennings 2013-07-10 1100
2b2811178e85553 Seth Jennings 2013-07-10 1101 /* populate entry */
2b2811178e85553 Seth Jennings 2013-07-10 1102 entry->offset = offset;
2b2811178e85553 Seth Jennings 2013-07-10 1103 entry->handle = handle;
2b2811178e85553 Seth Jennings 2013-07-10 1104 entry->length = dlen;
2b2811178e85553 Seth Jennings 2013-07-10 1105
a85f878b443f8d2 Srividya Desireddy 2018-01-31 1106 insert_entry:
2b2811178e85553 Seth Jennings 2013-07-10 1107 /* map */
2b2811178e85553 Seth Jennings 2013-07-10 1108
spin_lock(&tree->lock);
2b2811178e85553 Seth Jennings 2013-07-10 1109 do {
2b2811178e85553 Seth Jennings 2013-07-10 1110 ret =
zswap_rb_insert(&tree->rbroot, entry, &dupentry);
2b2811178e85553 Seth Jennings 2013-07-10 1111 if (ret == -EEXIST) {
2b2811178e85553 Seth Jennings 2013-07-10 1112 zswap_duplicate_entry++;
2b2811178e85553 Seth Jennings 2013-07-10 1113 /* remove from rbtree */
0ab0abcf511545d Weijie Yang 2013-11-12 1114
zswap_rb_erase(&tree->rbroot, dupentry);
0ab0abcf511545d Weijie Yang 2013-11-12 1115 zswap_entry_put(tree,
dupentry);
2b2811178e85553 Seth Jennings 2013-07-10 1116 }
2b2811178e85553 Seth Jennings 2013-07-10 1117 } while (ret == -EEXIST);
2b2811178e85553 Seth Jennings 2013-07-10 1118
spin_unlock(&tree->lock);
2b2811178e85553 Seth Jennings 2013-07-10 1119
2b2811178e85553 Seth Jennings 2013-07-10 1120 /* update stats */
2b2811178e85553 Seth Jennings 2013-07-10 1121
atomic_inc(&zswap_stored_pages);
f1c54846ee4504d Dan Streetman 2015-09-09 1122 zswap_update_total_size();
2b2811178e85553 Seth Jennings 2013-07-10 1123
2b2811178e85553 Seth Jennings 2013-07-10 1124 return 0;
2b2811178e85553 Seth Jennings 2013-07-10 1125
f1c54846ee4504d Dan Streetman 2015-09-09 1126 put_dstmem:
a9def13283a0cb8 Luis Claudio R. Goncalves 2019-06-25 1127
put_locked_var(zswap_dstmem_lock, zswap_dstmem);
f1c54846ee4504d Dan Streetman 2015-09-09 1128
zswap_pool_put(entry->pool);
f1c54846ee4504d Dan Streetman 2015-09-09 1129 freepage:
2b2811178e85553 Seth Jennings 2013-07-10 1130
zswap_entry_cache_free(entry);
2b2811178e85553 Seth Jennings 2013-07-10 1131 reject:
2b2811178e85553 Seth Jennings 2013-07-10 1132 return ret;
2b2811178e85553 Seth Jennings 2013-07-10 1133 }
2b2811178e85553 Seth Jennings 2013-07-10 1134
:::::: The code at line 995 was first introduced by commit
:::::: a9def13283a0cb8a1ae98f4efb20d77279f4383d mm/zswap: Do not disable preemption in
zswap_frontswap_store()
:::::: TO: Luis Claudio R. Goncalves <lclaudio(a)uudg.org>
:::::: CC: Andrew kim <andrew.kim(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org