From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7593332EB3 for ; Mon, 22 Dec 2025 18:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766426853; cv=none; b=SOUcj9PzE9ejb1tZ3aAhZF4pKGBRINftYPSMtyeEXsbmRWAaar5sQX3l4ec1Hy4YrhGs5TxdRtiJunb8CrbOcaVC1cVyhmDUSiqGhfxllbjUIlfT65LEk0F3HXnIJoM9Vb9Fr1sPnXO33vGDD4kz6pfar+TziYU1bWT6T0gdspk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766426853; c=relaxed/simple; bh=pz07FSO+xOatVH/lpEhVhWdyc62EAch9ckpWnY20ahY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cit1W+n1OulA7iDgQ42IkmBzdTFhISR43buz2LoJV2X3INJtVd7pXbGxMUlXeaC0amNTHUZX8jU4z++InQVKV4sFgEgk2gykdsPWl0OIdN1Gwv2MAunoVCK74jJqI5XN+/ZcYNFxCh5iirNzqmWvEWT2fRETffJVUvL085VMX/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TgzwDxvO; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TgzwDxvO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766426851; x=1797962851; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pz07FSO+xOatVH/lpEhVhWdyc62EAch9ckpWnY20ahY=; b=TgzwDxvOpS97AcxqCgwWP3wEQE40gURzJQwwTNVlWkYcoAPDbR00pq+g Nen5Tuzjsy9iP3ZXs6D+AUTjjKvUrNy812O1ybgOQw139JRdMM6V/5bP9 PHRvewnPZO7WKnqKVC5tk3e0DH2ciA1dhpNN1TL+h2dZ3y7v3YsoBuD5U TIshcfPBmOAnJmNXw+10QCTjUr2GX3tYmIhg9art7ttFUFS8AAuxL6Tsm Q+OnEI/8FXMyDQVyHVuYAR2G6lCFCbgEhmZ4SS71lWcClUZpToS1J/7ik vaf3zIQVuHiD9IMDhEa9E86dOb2XbSYh0jDXzsncaojzgjGSAAzKlIH86 Q==; X-CSE-ConnectionGUID: 1QJB12y4R+mSm+ItjfE3Ig== X-CSE-MsgGUID: wU04UubsQ9+1DRjb6xcvtA== X-IronPort-AV: E=McAfee;i="6800,10657,11650"; a="79401676" X-IronPort-AV: E=Sophos;i="6.21,168,1763452800"; d="scan'208";a="79401676" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2025 10:07:30 -0800 X-CSE-ConnectionGUID: ul4byNHcR4u3728hwhd0cw== X-CSE-MsgGUID: wu6eGePhSbqZyPxxnTn9hg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,168,1763452800"; d="scan'208";a="198822935" Received: from lkp-server02.sh.intel.com (HELO dd3453e2b682) ([10.239.97.151]) by orviesa010.jf.intel.com with ESMTP; 22 Dec 2025 10:07:29 -0800 Received: from kbuild by dd3453e2b682 with local (Exim 4.98.2) (envelope-from ) id 1vXkJa-000000000xf-1LsF; Mon, 22 Dec 2025 18:07:26 +0000 Date: Tue, 23 Dec 2025 02:06:59 +0800 From: kernel test robot To: Chuck Lever Cc: oe-kbuild-all@lists.linux.dev Subject: Re: [RFC PATCH 2/2] NFSD: Add asynchronous write throttling support Message-ID: <202512230126.gowu7NIP-lkp@intel.com> References: <20251219141105.1247093-3-cel@kernel.org> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251219141105.1247093-3-cel@kernel.org> Hi Chuck, [This is a private test report for your RFC patch.] kernel test robot noticed the following build errors: [auto build test ERROR on brauner-vfs/vfs.all] [also build test ERROR on linus/master v6.19-rc2 next-20251219] [cannot apply to hch-configfs/for-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Chuck-Lever/NFSD-Add-aggressive-write-throttling-control/20251219-221859 base: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all patch link: https://lore.kernel.org/r/20251219141105.1247093-3-cel%40kernel.org patch subject: [RFC PATCH 2/2] NFSD: Add asynchronous write throttling support config: parisc-randconfig-001-20251223 (https://download.01.org/0day-ci/archive/20251223/202512230126.gowu7NIP-lkp@intel.com/config) compiler: hppa-linux-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251223/202512230126.gowu7NIP-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/202512230126.gowu7NIP-lkp@intel.com/ All errors (new ones prefixed by >>): fs/nfsd/vfs.c: In function 'nfsd_vfs_write': >> fs/nfsd/vfs.c:1490:4: error: break statement not within loop or switch break; ^~~~~ vim +1490 fs/nfsd/vfs.c 1389 1390 /** 1391 * nfsd_vfs_write - write data to an already-open file 1392 * @rqstp: RPC execution context 1393 * @fhp: File handle of file to write into 1394 * @nf: An open file matching @fhp 1395 * @offset: Byte offset of start 1396 * @payload: xdr_buf containing the write payload 1397 * @cnt: IN: number of bytes to write, OUT: number of bytes actually written 1398 * @stable: An NFS stable_how value 1399 * @verf: NFS WRITE verifier 1400 * 1401 * Upon return, caller must invoke fh_put on @fhp. 1402 * 1403 * Return values: 1404 * An nfsstat value in network byte order. 1405 */ 1406 __be32 1407 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, 1408 struct nfsd_file *nf, loff_t offset, 1409 const struct xdr_buf *payload, unsigned long *cnt, 1410 int stable, __be32 *verf) 1411 { 1412 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 1413 struct file *file = nf->nf_file; 1414 struct super_block *sb = file_inode(file)->i_sb; 1415 struct kiocb kiocb; 1416 struct svc_export *exp; 1417 struct iov_iter iter; 1418 errseq_t since; 1419 __be32 nfserr; 1420 int host_err; 1421 unsigned long exp_op_flags = 0; 1422 unsigned int pflags = current->flags; 1423 bool restore_flags = false; 1424 unsigned int nvecs; 1425 int saved_nr_dirtied_pause = 0; 1426 bool throttle_adjusted = false; 1427 1428 trace_nfsd_write_opened(rqstp, fhp, offset, *cnt); 1429 1430 if (sb->s_export_op) 1431 exp_op_flags = sb->s_export_op->flags; 1432 1433 if (test_bit(RQ_LOCAL, &rqstp->rq_flags) && 1434 !(exp_op_flags & EXPORT_OP_REMOTE_FS)) { 1435 /* 1436 * We want throttling in balance_dirty_pages() 1437 * and shrink_inactive_list() to only consider 1438 * the backingdev we are writing to, so that nfs to 1439 * localhost doesn't cause nfsd to lock up due to all 1440 * the client's dirty pages or its congested queue. 1441 */ 1442 current->flags |= PF_LOCAL_THROTTLE; 1443 restore_flags = true; 1444 } 1445 1446 exp = fhp->fh_export; 1447 1448 /* 1449 * If aggressive write throttling is enabled, reduce the per-task 1450 * dirty page limit to throttle NFSD writes more aggressively. 1451 * This helps prevent memory exhaustion when fast network clients 1452 * overwhelm slow storage. 1453 */ 1454 if (nfsd_aggressive_write_throttle) { 1455 saved_nr_dirtied_pause = current->nr_dirtied_pause; 1456 current->nr_dirtied_pause = NFSD_AGGRESSIVE_DIRTY_LIMIT; 1457 throttle_adjusted = true; 1458 } 1459 1460 if (!EX_ISSYNC(exp)) 1461 stable = NFS_UNSTABLE; 1462 init_sync_kiocb(&kiocb, file); 1463 kiocb.ki_pos = offset; 1464 if (likely(!fhp->fh_use_wgather)) { 1465 switch (stable) { 1466 case NFS_FILE_SYNC: 1467 /* persist data and timestamps */ 1468 kiocb.ki_flags |= IOCB_DSYNC | IOCB_SYNC; 1469 break; 1470 case NFS_DATA_SYNC: 1471 /* persist data only */ 1472 kiocb.ki_flags |= IOCB_DSYNC; 1473 break; 1474 } 1475 } 1476 1477 /* 1478 * If async throttling is enabled, check memory pressure 1479 * before attempting buffered writes. Return -EAGAIN if 1480 * the system is low on memory, allowing NFSD to return 1481 * an NFS error code asking the client to retry later. 1482 * 1483 * Skip this for NFSv2 since it lacks NFSERR_JUKEBOX. 1484 */ 1485 if (nfsd_async_write_throttle && rqstp->rq_vers >= 3) { 1486 host_err = 1487 balance_dirty_pages_ratelimited_flags(file->f_mapping, 1488 BDP_ASYNC); 1489 if (host_err == -EAGAIN) > 1490 break; 1491 } 1492 1493 nvecs = xdr_buf_to_bvec(rqstp->rq_bvec, rqstp->rq_maxpages, payload); 1494 1495 since = READ_ONCE(file->f_wb_err); 1496 if (verf) 1497 nfsd_copy_write_verifier(verf, nn); 1498 1499 switch (nfsd_io_cache_write) { 1500 case NFSD_IO_DIRECT: 1501 host_err = nfsd_direct_write(rqstp, fhp, nf, nvecs, 1502 cnt, &kiocb); 1503 break; 1504 case NFSD_IO_DONTCACHE: 1505 if (file->f_op->fop_flags & FOP_DONTCACHE) 1506 kiocb.ki_flags |= IOCB_DONTCACHE; 1507 fallthrough; 1508 case NFSD_IO_BUFFERED: 1509 iov_iter_bvec(&iter, ITER_SOURCE, rqstp->rq_bvec, nvecs, *cnt); 1510 host_err = vfs_iocb_iter_write(file, &kiocb, &iter); 1511 if (host_err < 0) 1512 break; 1513 *cnt = host_err; 1514 break; 1515 } 1516 if (host_err < 0) { 1517 commit_reset_write_verifier(nn, rqstp, host_err); 1518 goto out_nfserr; 1519 } 1520 nfsd_stats_io_write_add(nn, exp, *cnt); 1521 fsnotify_modify(file); 1522 host_err = filemap_check_wb_err(file->f_mapping, since); 1523 if (host_err < 0) 1524 goto out_nfserr; 1525 1526 if (stable && fhp->fh_use_wgather) { 1527 host_err = wait_for_concurrent_writes(file); 1528 if (host_err < 0) 1529 commit_reset_write_verifier(nn, rqstp, host_err); 1530 } 1531 1532 out_nfserr: 1533 if (host_err >= 0) { 1534 trace_nfsd_write_io_done(rqstp, fhp, offset, *cnt); 1535 nfserr = nfs_ok; 1536 } else { 1537 trace_nfsd_write_err(rqstp, fhp, offset, host_err); 1538 nfserr = nfserrno(host_err); 1539 } 1540 if (throttle_adjusted) 1541 current->nr_dirtied_pause = saved_nr_dirtied_pause; 1542 if (restore_flags) 1543 current_restore_flags(pflags, PF_LOCAL_THROTTLE); 1544 return nfserr; 1545 } 1546 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki