From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4A9DC5ACB3 for ; Tue, 21 Nov 2023 09:15:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37B506B0423; Tue, 21 Nov 2023 04:15:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 32A9B6B043A; Tue, 21 Nov 2023 04:15:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F36C6B0442; Tue, 21 Nov 2023 04:15:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0FE626B0423 for ; Tue, 21 Nov 2023 04:15:32 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C16518046C for ; Tue, 21 Nov 2023 09:15:31 +0000 (UTC) X-FDA: 81481403262.15.04381EE Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by imf14.hostedemail.com (Postfix) with ESMTP id 7F1F1100009 for ; Tue, 21 Nov 2023 09:15:28 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=mTw7JJRw; spf=pass (imf14.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700558129; a=rsa-sha256; cv=none; b=hao0VkEpewNT/YcH7s3z9KVwaIlYq/55fo1cgI+LRYtHED5nUOMR9AK0GEjDjNM394mg2p MZ4NQPhAIjPjDXiOm9+e7vbjaUAofPpWbYFH5Rxhj4GSaypinephRuRbiOtPvy3eo4P2l1 35Wjk9HhF412BDtS7vy8KMURsuTNF7o= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=mTw7JJRw; spf=pass (imf14.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700558129; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=/F0hQsRSKCxHRQgyUw3ymrgymR5qT/H7IF+h1u66lZM=; b=E3pPG7gp2ffjFsKqd/pKo8ntgkHhTm4WgNoSLw7EXtGZjH/9K366YCOsdpzFSUO36TRQt3 gq7/JID/6BGf2uAKqOQRjLyt+xqJFM3yJb0/pYZ++245EVS/mKEiYk+e0JgUWuGTKbdJ02 xXeZXzfYa6A+Aq7uB3fqjQVAk8k6A3M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700558128; x=1732094128; h=date:from:to:cc:subject:message-id:mime-version; bh=ctb89/DHmfpjX4VccFpTj38fnlCWleZuMsgV3lfv0Cc=; b=mTw7JJRwcMIdBDyl71LohmIHeaBOxcli56En8cjf+q1x5pY5wN7uvK2w 1jmtDk7jf2B7XiuH6GKhbAWG/afuXn4M7f/dDhw0ttdp3A/pm7PU/6lby xIAa7bLa4eVHPx8hgrgTAeQiY7N2YQVIjWeJP3tMTHoR8Ym0+r0SPg0K8 l/Nq+tWTdgXMFHor5Xmf9R2uG+6tcw1LiCqdKzSn20V1DbPCyAzQsGi4R UU+Neu5x+ZmfeD2SyQxMp/gWLv5liSEwE8PkLr8Ci4EnzfvF+eIOZtqHL Y3hyBmpxBPgfP5sO1mniEuLRd7857w1ubfo9FsaVXABzB560J5B441Efb A==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="422897990" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="422897990" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 01:15:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="766581380" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="766581380" Received: from lkp-server02.sh.intel.com (HELO b8de5498638e) ([10.239.97.151]) by orsmga002.jf.intel.com with ESMTP; 21 Nov 2023 01:15:25 -0800 Received: from kbuild by b8de5498638e with local (Exim 4.96) (envelope-from ) id 1r5Mqd-0007dg-1e; Tue, 21 Nov 2023 09:15:17 +0000 Date: Tue, 21 Nov 2023 17:12:48 +0800 From: kernel test robot To: Kent Overstreet Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: [linux-next:master 1705/2217] fs/bcachefs/btree_write_buffer.c:216:25: error: implicit declaration of function 'prefetch' Message-ID: <202311211650.4gRNvqfL-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7F1F1100009 X-Stat-Signature: yqfwdbn3tqytbsrypxqp71oj7kct84zm X-Rspam-User: X-HE-Tag: 1700558128-684244 X-HE-Meta: U2FsdGVkX19YL//C42BR11leckHPxv+GrJnpsxuwMHYqcb1M3gwTeosz/e2SMX4DjGYXtHWr+IoyTUtChjrFfY7C20QMc128AIeu7fsx4t1iK1a1DCUHoszJp28klnS4hAcBKTFsdp6XLo8v/x1L5Kx8isUQUf0vKCam8sRGYuOXsSaslPDrIbY8X68tMSFWFPnuyjqMcPX+eg/w6uEAq1kkklfRfpMUz9rF6guXK/RYMb1k0LO3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U3XK6/9plZSVzWMN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 07b677953b9dca02928be323e2db853511305fa9 commit: 9e5a6c7797b240f138b9bdd75d85d8f7c6f0e06d [1705/2217] bcachefs: btree write buffer now slurps keys from journal config: arc-allmodconfig (https://download.01.org/0day-ci/archive/20231121/202311211650.4gRNvqfL-lkp@intel.com/config) compiler: arceb-elf-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231121/202311211650.4gRNvqfL-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202311211650.4gRNvqfL-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from fs/bcachefs/bcachefs.h:206, from fs/bcachefs/btree_write_buffer.c:3: fs/bcachefs/bcachefs_format.h:215:25: warning: 'p' offset 3 in 'struct bkey' isn't aligned to 4 [-Wpacked-not-aligned] 215 | struct bpos p; | ^ fs/bcachefs/bcachefs_format.h:217:25: warning: 'version' offset 27 in 'struct bkey' isn't aligned to 4 [-Wpacked-not-aligned] 217 | struct bversion version; | ^~~~~~~ In file included from fs/bcachefs/bcachefs.h:421: fs/bcachefs/btree_write_buffer_types.h:23:9: warning: alignment 1 of 'struct ' is less than 4 [-Wpacked-not-aligned] 23 | } __packed; | ^ fs/bcachefs/btree_write_buffer_types.h:20:49: warning: 'pos' offset 1 in 'struct ' isn't aligned to 4 [-Wpacked-not-aligned] 20 | struct bpos pos; | ^~~ In file included from fs/bcachefs/btree_write_buffer.c:8: fs/bcachefs/error.h: In function 'bch2_bkey_fsck_err': fs/bcachefs/error.h:168:9: warning: function 'bch2_bkey_fsck_err' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 168 | prt_vprintf(err_msg, fmt, args); | ^~~~~~~~~~~ fs/bcachefs/btree_write_buffer.c: In function 'bch2_btree_write_buffer_flush_locked': >> fs/bcachefs/btree_write_buffer.c:216:25: error: implicit declaration of function 'prefetch' [-Werror=implicit-function-declaration] 216 | prefetch(&wb->flushing.keys.data[n->idx]); | ^~~~~~~~ cc1: some warnings being treated as errors vim +/prefetch +216 fs/bcachefs/btree_write_buffer.c 168 169 static int bch2_btree_write_buffer_flush_locked(struct btree_trans *trans) 170 { 171 struct bch_fs *c = trans->c; 172 struct journal *j = &c->journal; 173 struct btree_write_buffer *wb = &c->btree_write_buffer; 174 struct wb_key_ref *i; 175 struct btree_iter iter = { NULL }; 176 size_t skipped = 0, fast = 0, slowpath = 0; 177 bool write_locked = false; 178 int ret = 0; 179 180 bch2_trans_unlock(trans); 181 bch2_trans_begin(trans); 182 183 mutex_lock(&wb->inc.lock); 184 move_keys_from_inc_to_flushing(wb); 185 mutex_unlock(&wb->inc.lock); 186 187 for (size_t i = 0; i < wb->flushing.keys.nr; i++) { 188 wb->sorted.data[i].idx = i; 189 wb->sorted.data[i].btree = wb->flushing.keys.data[i].btree; 190 wb->sorted.data[i].pos = wb->flushing.keys.data[i].k.k.p; 191 } 192 wb->sorted.nr = wb->flushing.keys.nr; 193 194 /* 195 * We first sort so that we can detect and skip redundant updates, and 196 * then we attempt to flush in sorted btree order, as this is most 197 * efficient. 198 * 199 * However, since we're not flushing in the order they appear in the 200 * journal we won't be able to drop our journal pin until everything is 201 * flushed - which means this could deadlock the journal if we weren't 202 * passing BCH_TRANS_COMMIT_journal_reclaim. This causes the update to fail 203 * if it would block taking a journal reservation. 204 * 205 * If that happens, simply skip the key so we can optimistically insert 206 * as many keys as possible in the fast path. 207 */ 208 sort(wb->sorted.data, wb->sorted.nr, 209 sizeof(wb->sorted.data[0]), 210 wb_key_cmp, NULL); 211 212 darray_for_each(wb->sorted, i) { 213 struct btree_write_buffered_key *k = &wb->flushing.keys.data[i->idx]; 214 215 for (struct wb_key_ref *n = i + 1; n < min(i + 4, &darray_top(wb->sorted)); n++) > 216 prefetch(&wb->flushing.keys.data[n->idx]); 217 218 BUG_ON(!k->journal_seq); 219 220 if (i + 1 < &darray_top(wb->sorted) && 221 i[0].btree == i[1].btree && 222 bpos_eq(i[0].pos, i[1].pos)) { 223 struct btree_write_buffered_key *n = &wb->flushing.keys.data[i[1].idx]; 224 225 skipped++; 226 n->journal_seq = min_t(u64, n->journal_seq, k->journal_seq);; 227 k->journal_seq = 0; 228 continue; 229 } 230 231 if (write_locked && 232 (iter.path->btree_id != k->btree || 233 bpos_gt(k->k.k.p, iter.path->l[0].b->key.k.p))) { 234 bch2_btree_node_unlock_write(trans, iter.path, iter.path->l[0].b); 235 write_locked = false; 236 } 237 238 if (!iter.path || iter.path->btree_id != k->btree) { 239 bch2_trans_iter_exit(trans, &iter); 240 bch2_trans_iter_init(trans, &iter, k->btree, k->k.k.p, 241 BTREE_ITER_INTENT|BTREE_ITER_ALL_SNAPSHOTS); 242 } 243 244 bch2_btree_iter_set_pos(&iter, k->k.k.p); 245 iter.path->preserve = false; 246 247 do { 248 if (race_fault()) { 249 ret = -BCH_ERR_journal_reclaim_would_deadlock; 250 break; 251 } 252 253 ret = wb_flush_one(trans, &iter, k, &write_locked, &fast); 254 if (!write_locked) 255 bch2_trans_begin(trans); 256 } while (bch2_err_matches(ret, BCH_ERR_transaction_restart)); 257 258 if (!ret) { 259 k->journal_seq = 0; 260 } else if (ret == -BCH_ERR_journal_reclaim_would_deadlock) { 261 slowpath++; 262 ret = 0; 263 } else 264 break; 265 } 266 267 if (write_locked) 268 bch2_btree_node_unlock_write(trans, iter.path, iter.path->l[0].b); 269 bch2_trans_iter_exit(trans, &iter); 270 271 if (ret) 272 goto err; 273 274 if (slowpath) { 275 /* 276 * Flush in the order they were present in the journal, so that 277 * we can release journal pins: 278 * The fastpath zapped the seq of keys that were successfully flushed so 279 * we can skip those here. 280 */ 281 trace_write_buffer_flush_slowpath(trans, slowpath, wb->flushing.keys.nr); 282 283 struct btree_write_buffered_key *i; 284 darray_for_each(wb->flushing.keys, i) { 285 if (!i->journal_seq) 286 continue; 287 288 bch2_journal_pin_update(j, i->journal_seq, &wb->flushing.pin, 289 bch2_btree_write_buffer_journal_flush); 290 291 bch2_trans_begin(trans); 292 293 ret = commit_do(trans, NULL, NULL, 294 BCH_WATERMARK_reclaim| 295 BCH_TRANS_COMMIT_no_check_rw| 296 BCH_TRANS_COMMIT_no_enospc| 297 BCH_TRANS_COMMIT_no_journal_res| 298 BCH_TRANS_COMMIT_journal_reclaim, 299 btree_write_buffered_insert(trans, i)); 300 if (ret) 301 goto err; 302 } 303 } 304 err: 305 bch2_fs_fatal_err_on(ret, c, "%s: insert error %s", __func__, bch2_err_str(ret)); 306 trace_write_buffer_flush(trans, wb->flushing.keys.nr, skipped, fast, 0); 307 bch2_journal_pin_drop(j, &wb->flushing.pin); 308 wb->flushing.keys.nr = 0; 309 return ret; 310 } 311 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki