linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
@ 2023-07-26 22:43 kernel test robot
  2023-07-27  3:36 ` [EXTERNAL] " Steven French
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-07-26 22:43 UTC (permalink / raw)
  To: Steve French; +Cc: llvm, oe-kbuild-all, linux-kernel

Hi Steve,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0a8db05b571ad5b8d5c8774a004c0424260a90bd
commit: 38c8a9a52082579090e34c033d439ed2cd1a462d smb: move client and server files to common directory fs/smb
date:   9 weeks ago
config: mips-loongson2k_defconfig (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307270640.5ODmPwDl-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than]
     160 | int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
         |     ^
   1 warning generated.


vim +/cifs_try_adding_channels +160 fs/smb/client/sess.c

b54034a73baf9f fs/cifs/sess.c Shyam Prasad N  2022-01-03  158  
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  159  /* returns number of channels added */
387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14 @160  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  161  {
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  162  	struct TCP_Server_Info *server = ses->server;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  163  	int old_chan_count, new_chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  164  	int left;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  165  	int rc = 0;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  166  	int tries = 0;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  167  	struct cifs_server_iface *iface = NULL, *niface = NULL;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  168  
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  169  	spin_lock(&ses->chan_lock);
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  170  
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  171  	new_chan_count = old_chan_count = ses->chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  172  	left = ses->chan_max - ses->chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  173  
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  174  	if (left <= 0) {
88b024f556fcd5 fs/cifs/sess.c Shyam Prasad N  2021-11-19  175  		spin_unlock(&ses->chan_lock);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  176  		cifs_dbg(FYI,
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  177  			 "ses already at max_channels (%zu), nothing to open\n",
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  178  			 ses->chan_max);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  179  		return 0;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  180  	}
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  181  
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  182  	if (server->dialect < SMB30_PROT_ID) {
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  183  		spin_unlock(&ses->chan_lock);
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  184  		cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  185  		return 0;
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  186  	}
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  187  
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  188  	if (!(server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  189  		ses->chan_max = 1;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  190  		spin_unlock(&ses->chan_lock);
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  191  		cifs_server_dbg(VFS, "no multichannel support\n");
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  192  		return 0;
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  193  	}
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  194  	spin_unlock(&ses->chan_lock);
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  195  
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  196  	/*
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  197  	 * Keep connecting to same, fastest, iface for all channels as
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  198  	 * long as its RSS. Try next fastest one if not RSS or channel
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  199  	 * creation fails.
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  200  	 */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  201  	spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  202  	iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  203  				 iface_head);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  204  	spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  205  
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  206  	while (left > 0) {
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  207  
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  208  		tries++;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  209  		if (tries > 3*ses->chan_max) {
bbbf9eafbfdaa2 fs/cifs/sess.c Steve French    2020-05-30  210  			cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n",
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  211  				 left);
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  212  			break;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  213  		}
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  214  
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  215  		spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  216  		if (!ses->iface_count) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  217  			spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  218  			break;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  219  		}
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  220  
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  221  		list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  222  				    iface_head) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  223  			/* skip ifaces that are unusable */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  224  			if (!iface->is_active ||
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  225  			    (is_ses_using_iface(ses, iface) &&
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  226  			     !iface->rss_capable)) {
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  227  				continue;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  228  			}
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  229  
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  230  			/* take ref before unlock */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  231  			kref_get(&iface->refcount);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  232  
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  233  			spin_unlock(&ses->iface_lock);
387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14  234  			rc = cifs_ses_add_channel(cifs_sb, ses, iface);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  235  			spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  236  
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  237  			if (rc) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  238  				cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  239  					 &iface->sockaddr,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  240  					 rc);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  241  				kref_put(&iface->refcount, release_iface);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  242  				continue;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  243  			}
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  244  
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  245  			cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n",
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  246  				 &iface->sockaddr);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  247  			break;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  248  		}
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  249  		spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  250  
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  251  		left--;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  252  		new_chan_count++;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  253  	}
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  254  
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  255  	return new_chan_count - old_chan_count;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  256  }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  257  

:::::: The code at line 160 was first introduced by commit
:::::: 387ec58f339b0c45e3767395f11fa8dd3772131e cifs: simplify handling of cifs_sb/ctx->local_nls

:::::: TO: Ronnie Sahlberg <lsahlber@redhat.com>
:::::: CC: Steve French <stfrench@microsoft.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
  2023-07-26 22:43 fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels' kernel test robot
@ 2023-07-27  3:36 ` Steven French
  2023-07-27 16:40   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Steven French @ 2023-07-27  3:36 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, oe-kbuild-all, linux-kernel

Does anyone recognize the problem here - the stack size it is complaining about has a small stack usage not a large one
     cifs_try_adding_channels   has five pointers and five ints on the stack.  That seems small - not large.  It is called by cifs_mount which doesn't seem too bad in its stack usage either.

Any ideas why the stack size complaint is made?

-----Original Message-----
From: kernel test robot <lkp@intel.com>
Sent: Wednesday, July 26, 2023 5:44 PM
To: Steven French <Steven.French@microsoft.com>
Cc: llvm@lists.linux.dev; oe-kbuild-all@lists.linux.dev; linux-kernel@vger.kernel.org
Subject: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'

Hi Steve,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0a8db05b571ad5b8d5c8774a004c0424260a90bd
commit: 38c8a9a52082579090e34c033d439ed2cd1a462d smb: move client and server files to common directory fs/smb
date:   9 weeks ago
config: mips-loongson2k_defconfig (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-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 <lkp@intel.com>
| Closes:
| https://lore/
| .kernel.org%2Foe-kbuild-all%2F202307270640.5ODmPwDl-lkp%40intel.com%2F
| &data=05%7C01%7CSteven.French%40microsoft.com%7C2cc584fd937a4cd5b9d008
| db8e29f75b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63826008313023
| 4737%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
| iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AauGIxZRPM5DK1J5j6lyEp
| jOkArxfVtIUAnmPcxcCQs%3D&reserved=0

All warnings (new ones prefixed by >>):

>> fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds
>> limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than]
     160 | int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
         |     ^
   1 warning generated.


vim +/cifs_try_adding_channels +160 fs/smb/client/sess.c

b54034a73baf9f fs/cifs/sess.c Shyam Prasad N  2022-01-03  158
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  159  /* returns number of channels added */ 387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14 @160  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  161  {
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  162   struct TCP_Server_Info *server = ses->server;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  163   int old_chan_count, new_chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  164   int left;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  165   int rc = 0;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  166   int tries = 0;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  167   struct cifs_server_iface *iface = NULL, *niface = NULL;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  168
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  169   spin_lock(&ses->chan_lock);
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  170
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  171   new_chan_count = old_chan_count = ses->chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  172   left = ses->chan_max - ses->chan_count;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  173
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  174   if (left <= 0) {
88b024f556fcd5 fs/cifs/sess.c Shyam Prasad N  2021-11-19  175           spin_unlock(&ses->chan_lock);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  176           cifs_dbg(FYI,
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  177                    "ses already at max_channels (%zu), nothing to open\n",
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  178                    ses->chan_max);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  179           return 0;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  180   }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  181
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  182   if (server->dialect < SMB30_PROT_ID) {
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  183           spin_unlock(&ses->chan_lock);
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  184           cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  185           return 0;
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  186   }
53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  187
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  188   if (!(server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  189           ses->chan_max = 1;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  190           spin_unlock(&ses->chan_lock);
90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  191           cifs_server_dbg(VFS, "no multichannel support\n");
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  192           return 0;
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  193   }
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  194   spin_unlock(&ses->chan_lock);
9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  195
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  196   /*
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  197    * Keep connecting to same, fastest, iface for all channels as
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  198    * long as its RSS. Try next fastest one if not RSS or channel
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  199    * creation fails.
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  200    */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  201   spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  202   iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  203                            iface_head);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  204   spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  205
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  206   while (left > 0) {
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  207
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  208           tries++;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  209           if (tries > 3*ses->chan_max) {
bbbf9eafbfdaa2 fs/cifs/sess.c Steve French    2020-05-30  210                   cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n",
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  211                            left);
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  212                   break;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  213           }
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  214
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  215           spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  216           if (!ses->iface_count) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  217                   spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  218                   break;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  219           }
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  220
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  221           list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  222                               iface_head) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  223                   /* skip ifaces that are unusable */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  224                   if (!iface->is_active ||
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  225                       (is_ses_using_iface(ses, iface) &&
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  226                        !iface->rss_capable)) {
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  227                           continue;
65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  228                   }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  229
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  230                   /* take ref before unlock */
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  231                   kref_get(&iface->refcount);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  232
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  233                   spin_unlock(&ses->iface_lock);
387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14  234                   rc = cifs_ses_add_channel(cifs_sb, ses, iface);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  235                   spin_lock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  236
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  237                   if (rc) {
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  238                           cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  239                                    &iface->sockaddr,
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  240                                    rc);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  241                           kref_put(&iface->refcount, release_iface);
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  242                           continue;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  243                   }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  244
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  245                   cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n",
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  246                            &iface->sockaddr);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  247                   break;
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  248           }
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  249           spin_unlock(&ses->iface_lock);
aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  250
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  251           left--;
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  252           new_chan_count++;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  253   }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  254
724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  255   return new_chan_count - old_chan_count;
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  256  }
d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  257

:::::: The code at line 160 was first introduced by commit
:::::: 387ec58f339b0c45e3767395f11fa8dd3772131e cifs: simplify handling of cifs_sb/ctx->local_nls

:::::: TO: Ronnie Sahlberg <lsahlber@redhat.com>
:::::: CC: Steve French <stfrench@microsoft.com>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
  2023-07-27  3:36 ` [EXTERNAL] " Steven French
@ 2023-07-27 16:40   ` Nathan Chancellor
  2023-07-27 18:32     ` Steven French
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2023-07-27 16:40 UTC (permalink / raw)
  To: Steven French; +Cc: kernel test robot, llvm, oe-kbuild-all, linux-kernel

Hi Steve,

On Thu, Jul 27, 2023 at 03:36:11AM +0000, Steven French wrote:
> Does anyone recognize the problem here - the stack size it is complaining about has a small stack usage not a large one
>      cifs_try_adding_channels   has five pointers and five ints on the stack.  That seems small - not large.  It is called by cifs_mount which doesn't seem too bad in its stack usage either.
> 
> Any ideas why the stack size complaint is made?

Unfortunately, it seems like a recent-ish LLVM change removed the handy
spill/variable information that would have shed a little more immediate
light on this situation:

https://github.com/ClangBuiltLinux/linux/issues/1894

Building with a version that has that reveals:

  fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than]
  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
      ^
  412/1152 (35.76%) spills, 740/1152 (64.24%) variables
  1 warning generated.

The spills are definitely not great but it looks like there is a
moderately large stack variable in cifs_ses_add_channel(), which gets
inlined into cifs_try_adding_channels(). Unfortunately, pahole appears
to be borked for me but -Rpass-analysis=stack-frame-layout shows it:

  fs/smb/client/sess.c:161:1: remark:
  Function: cifs_try_adding_channels
  Offset: [SP-8], Type: Spill, Align: 8, Size: 8
  Offset: [SP-16], Type: Spill, Align: 8, Size: 8
  Offset: [SP-24], Type: Spill, Align: 8, Size: 8
  Offset: [SP-32], Type: Spill, Align: 8, Size: 8
  Offset: [SP-40], Type: Spill, Align: 8, Size: 8
  Offset: [SP-48], Type: Spill, Align: 8, Size: 8
  Offset: [SP-56], Type: Spill, Align: 8, Size: 8
  Offset: [SP-64], Type: Spill, Align: 8, Size: 8
  Offset: [SP-72], Type: Spill, Align: 8, Size: 8
  Offset: [SP-80], Type: Spill, Align: 8, Size: 8
  Offset: [SP-88], Type: Protector, Align: 8, Size: 8
  Offset: [SP-712], Type: Variable, Align: 8, Size: 624  <-- ctx, struct smb3_fs_context
  Offset: [SP-801], Type: Variable, Align: 1, Size: 89
  Offset: [SP-816], Type: Spill, Align: 8, Size: 8
  Offset: [SP-824], Type: Spill, Align: 8, Size: 8
  Offset: [SP-832], Type: Spill, Align: 8, Size: 8
  Offset: [SP-840], Type: Spill, Align: 8, Size: 8
  Offset: [SP-848], Type: Spill, Align: 8, Size: 8
  Offset: [SP-856], Type: Spill, Align: 8, Size: 8
  Offset: [SP-864], Type: Spill, Align: 8, Size: 8
  Offset: [SP-872], Type: Spill, Align: 8, Size: 8
  Offset: [SP-880], Type: Spill, Align: 8, Size: 8
  Offset: [SP-888], Type: Spill, Align: 8, Size: 8
  Offset: [SP-896], Type: Spill, Align: 8, Size: 8
  Offset: [SP-904], Type: Spill, Align: 8, Size: 8
  Offset: [SP-912], Type: Spill, Align: 8, Size: 8
  Offset: [SP-920], Type: Spill, Align: 8, Size: 8
  Offset: [SP-928], Type: Spill, Align: 8, Size: 8
  Offset: [SP-936], Type: Spill, Align: 8, Size: 8
  Offset: [SP-944], Type: Spill, Align: 8, Size: 8
  Offset: [SP-952], Type: Spill, Align: 8, Size: 8
  Offset: [SP-960], Type: Spill, Align: 8, Size: 8
  Offset: [SP-968], Type: Spill, Align: 8, Size: 8
  Offset: [SP-976], Type: Spill, Align: 8, Size: 8
  Offset: [SP-984], Type: Spill, Align: 8, Size: 8
  Offset: [SP-992], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1000], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1008], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1016], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1024], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1028], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1040], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1048], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1056], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1064], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1072], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1080], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1088], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1096], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1104], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1112], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1120], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1124], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1128], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1136], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1144], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1152], Type: Spill, Align: 8, Size: 8 [-Rpass-analysis=stack-frame-layout]
    161 | {
        | ^

There is probably more we can do on the compiler side to improve the
spills but I suspect marking cifs_ses_add_channel() as
noinline_for_stack or switching ctx to a head allocation would resolve
this.

Cheers,
Nathan

> -----Original Message-----
> From: kernel test robot <lkp@intel.com>
> Sent: Wednesday, July 26, 2023 5:44 PM
> To: Steven French <Steven.French@microsoft.com>
> Cc: llvm@lists.linux.dev; oe-kbuild-all@lists.linux.dev; linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
> 
> Hi Steve,
> 
> First bad commit (maybe != root cause):
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   0a8db05b571ad5b8d5c8774a004c0424260a90bd
> commit: 38c8a9a52082579090e34c033d439ed2cd1a462d smb: move client and server files to common directory fs/smb
> date:   9 weeks ago
> config: mips-loongson2k_defconfig (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce: (https://download.01.org/0day-ci/archive/20230727/202307270640.5ODmPwDl-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 <lkp@intel.com>
> | Closes:
> | https://lore/
> | .kernel.org%2Foe-kbuild-all%2F202307270640.5ODmPwDl-lkp%40intel.com%2F
> | &data=05%7C01%7CSteven.French%40microsoft.com%7C2cc584fd937a4cd5b9d008
> | db8e29f75b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63826008313023
> | 4737%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
> | iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AauGIxZRPM5DK1J5j6lyEp
> | jOkArxfVtIUAnmPcxcCQs%3D&reserved=0
> 
> All warnings (new ones prefixed by >>):
> 
> >> fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds
> >> limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than]
>      160 | int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
>          |     ^
>    1 warning generated.
> 
> 
> vim +/cifs_try_adding_channels +160 fs/smb/client/sess.c
> 
> b54034a73baf9f fs/cifs/sess.c Shyam Prasad N  2022-01-03  158
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  159  /* returns number of channels added */ 387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14 @160  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  161  {
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  162   struct TCP_Server_Info *server = ses->server;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  163   int old_chan_count, new_chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  164   int left;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  165   int rc = 0;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  166   int tries = 0;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  167   struct cifs_server_iface *iface = NULL, *niface = NULL;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  168
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  169   spin_lock(&ses->chan_lock);
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  170
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  171   new_chan_count = old_chan_count = ses->chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  172   left = ses->chan_max - ses->chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  173
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  174   if (left <= 0) {
> 88b024f556fcd5 fs/cifs/sess.c Shyam Prasad N  2021-11-19  175           spin_unlock(&ses->chan_lock);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  176           cifs_dbg(FYI,
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  177                    "ses already at max_channels (%zu), nothing to open\n",
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  178                    ses->chan_max);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  179           return 0;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  180   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  181
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  182   if (server->dialect < SMB30_PROT_ID) {
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  183           spin_unlock(&ses->chan_lock);
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  184           cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  185           return 0;
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  186   }
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  187
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  188   if (!(server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  189           ses->chan_max = 1;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  190           spin_unlock(&ses->chan_lock);
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  191           cifs_server_dbg(VFS, "no multichannel support\n");
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  192           return 0;
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  193   }
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  194   spin_unlock(&ses->chan_lock);
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  195
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  196   /*
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  197    * Keep connecting to same, fastest, iface for all channels as
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  198    * long as its RSS. Try next fastest one if not RSS or channel
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  199    * creation fails.
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  200    */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  201   spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  202   iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  203                            iface_head);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  204   spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  205
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  206   while (left > 0) {
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  207
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  208           tries++;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  209           if (tries > 3*ses->chan_max) {
> bbbf9eafbfdaa2 fs/cifs/sess.c Steve French    2020-05-30  210                   cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n",
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  211                            left);
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  212                   break;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  213           }
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  214
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  215           spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  216           if (!ses->iface_count) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  217                   spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  218                   break;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  219           }
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  220
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  221           list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  222                               iface_head) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  223                   /* skip ifaces that are unusable */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  224                   if (!iface->is_active ||
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  225                       (is_ses_using_iface(ses, iface) &&
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  226                        !iface->rss_capable)) {
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  227                           continue;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  228                   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  229
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  230                   /* take ref before unlock */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  231                   kref_get(&iface->refcount);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  232
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  233                   spin_unlock(&ses->iface_lock);
> 387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14  234                   rc = cifs_ses_add_channel(cifs_sb, ses, iface);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  235                   spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  236
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  237                   if (rc) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  238                           cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  239                                    &iface->sockaddr,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  240                                    rc);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  241                           kref_put(&iface->refcount, release_iface);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  242                           continue;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  243                   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  244
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  245                   cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n",
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  246                            &iface->sockaddr);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  247                   break;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  248           }
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  249           spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  250
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  251           left--;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  252           new_chan_count++;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  253   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  254
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  255   return new_chan_count - old_chan_count;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  256  }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  257
> 
> :::::: The code at line 160 was first introduced by commit
> :::::: 387ec58f339b0c45e3767395f11fa8dd3772131e cifs: simplify handling of cifs_sb/ctx->local_nls
> 
> :::::: TO: Ronnie Sahlberg <lsahlber@redhat.com>
> :::::: CC: Steve French <stfrench@microsoft.com>
> 
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
  2023-07-27 16:40   ` Nathan Chancellor
@ 2023-07-27 18:32     ` Steven French
  0 siblings, 0 replies; 4+ messages in thread
From: Steven French @ 2023-07-27 18:32 UTC (permalink / raw)
  To: Nathan Chancellor, ronnie sahlberg
  Cc: kernel test robot, llvm, oe-kbuild-all, linux-kernel, Shyam Prasad, pc

> There is probably more we can do on the compiler side to improve the spills but I suspect marking cifs_ses_add_channel() as noinline_for_stack or switching ctx to a head allocation would resolve this.

That makes sense - looks like the problem was introduced by putting a large variable ctx (which is struct smb3_fs_context) on the stack in cifs_ses_add_channel() in sess.c line 363 for the patch referenced below

387ec58f339b0c45e3767395f11fa8dd3772131e cifs: simplify handling of cifs_sb/ctx->local_nls
(followed by "cifs: rename smb_vol as smb_fs_context and move it to fs_context.h")

And could be fixed by malloc of ctx instead.   Probably not urgent and was only detected due to the directory move of these files from fs/cifs to fs/smb/client so could do this for 6.6-rc



-----Original Message-----
From: Nathan Chancellor <nathan@kernel.org>
Sent: Thursday, July 27, 2023 11:40 AM
To: Steven French <Steven.French@microsoft.com>
Cc: kernel test robot <lkp@intel.com>; llvm@lists.linux.dev; oe-kbuild-all@lists.linux.dev; linux-kernel@vger.kernel.org
Subject: Re: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'

[You don't often get email from nathan@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Steve,

On Thu, Jul 27, 2023 at 03:36:11AM +0000, Steven French wrote:
> Does anyone recognize the problem here - the stack size it is complaining about has a small stack usage not a large one
>      cifs_try_adding_channels   has five pointers and five ints on the stack.  That seems small - not large.  It is called by cifs_mount which doesn't seem too bad in its stack usage either.
>
> Any ideas why the stack size complaint is made?

Unfortunately, it seems like a recent-ish LLVM change removed the handy spill/variable information that would have shed a little more immediate light on this situation:

https://github.com/ClangBuiltLinux/linux/issues/1894

Building with a version that has that reveals:

  fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than]
  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
      ^
  412/1152 (35.76%) spills, 740/1152 (64.24%) variables
  1 warning generated.

The spills are definitely not great but it looks like there is a moderately large stack variable in cifs_ses_add_channel(), which gets inlined into cifs_try_adding_channels(). Unfortunately, pahole appears to be borked for me but -Rpass-analysis=stack-frame-layout shows it:

  fs/smb/client/sess.c:161:1: remark:
  Function: cifs_try_adding_channels
  Offset: [SP-8], Type: Spill, Align: 8, Size: 8
  Offset: [SP-16], Type: Spill, Align: 8, Size: 8
  Offset: [SP-24], Type: Spill, Align: 8, Size: 8
  Offset: [SP-32], Type: Spill, Align: 8, Size: 8
  Offset: [SP-40], Type: Spill, Align: 8, Size: 8
  Offset: [SP-48], Type: Spill, Align: 8, Size: 8
  Offset: [SP-56], Type: Spill, Align: 8, Size: 8
  Offset: [SP-64], Type: Spill, Align: 8, Size: 8
  Offset: [SP-72], Type: Spill, Align: 8, Size: 8
  Offset: [SP-80], Type: Spill, Align: 8, Size: 8
  Offset: [SP-88], Type: Protector, Align: 8, Size: 8
  Offset: [SP-712], Type: Variable, Align: 8, Size: 624  <-- ctx, struct smb3_fs_context
  Offset: [SP-801], Type: Variable, Align: 1, Size: 89
  Offset: [SP-816], Type: Spill, Align: 8, Size: 8
  Offset: [SP-824], Type: Spill, Align: 8, Size: 8
  Offset: [SP-832], Type: Spill, Align: 8, Size: 8
  Offset: [SP-840], Type: Spill, Align: 8, Size: 8
  Offset: [SP-848], Type: Spill, Align: 8, Size: 8
  Offset: [SP-856], Type: Spill, Align: 8, Size: 8
  Offset: [SP-864], Type: Spill, Align: 8, Size: 8
  Offset: [SP-872], Type: Spill, Align: 8, Size: 8
  Offset: [SP-880], Type: Spill, Align: 8, Size: 8
  Offset: [SP-888], Type: Spill, Align: 8, Size: 8
  Offset: [SP-896], Type: Spill, Align: 8, Size: 8
  Offset: [SP-904], Type: Spill, Align: 8, Size: 8
  Offset: [SP-912], Type: Spill, Align: 8, Size: 8
  Offset: [SP-920], Type: Spill, Align: 8, Size: 8
  Offset: [SP-928], Type: Spill, Align: 8, Size: 8
  Offset: [SP-936], Type: Spill, Align: 8, Size: 8
  Offset: [SP-944], Type: Spill, Align: 8, Size: 8
  Offset: [SP-952], Type: Spill, Align: 8, Size: 8
  Offset: [SP-960], Type: Spill, Align: 8, Size: 8
  Offset: [SP-968], Type: Spill, Align: 8, Size: 8
  Offset: [SP-976], Type: Spill, Align: 8, Size: 8
  Offset: [SP-984], Type: Spill, Align: 8, Size: 8
  Offset: [SP-992], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1000], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1008], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1016], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1024], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1028], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1040], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1048], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1056], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1064], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1072], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1080], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1088], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1096], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1104], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1112], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1120], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1124], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1128], Type: Spill, Align: 4, Size: 4
  Offset: [SP-1136], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1144], Type: Spill, Align: 8, Size: 8
  Offset: [SP-1152], Type: Spill, Align: 8, Size: 8 [-Rpass-analysis=stack-frame-layout]
    161 | {
        | ^

There is probably more we can do on the compiler side to improve the spills but I suspect marking cifs_ses_add_channel() as noinline_for_stack or switching ctx to a head allocation would resolve this.

Cheers,
Nathan

> -----Original Message-----
> From: kernel test robot <lkp@intel.com>
> Sent: Wednesday, July 26, 2023 5:44 PM
> To: Steven French <Steven.French@microsoft.com>
> Cc: llvm@lists.linux.dev; oe-kbuild-all@lists.linux.dev;
> linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels'
>
> Hi Steve,
>
> First bad commit (maybe != root cause):
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   0a8db05b571ad5b8d5c8774a004c0424260a90bd
> commit: 38c8a9a52082579090e34c033d439ed2cd1a462d smb: move client and server files to common directory fs/smb
> date:   9 weeks ago
> config: mips-loongson2k_defconfig
> (https://dow/
> nload.01.org%2F0day-ci%2Farchive%2F20230727%2F202307270640.5ODmPwDl-lk
> p%40intel.com%2Fconfig&data=05%7C01%7CSteven.French%40microsoft.com%7C
> b15fd25d8a424332574308db8ec022d5%7C72f988bf86f141af91ab2d7cd011db47%7C
> 1%7C0%7C638260728110528650%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDA
> iLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=
> ONikRy3GwMEm0EWCqwfjVxodTVYK3XGUitvOCtdwkEI%3D&reserved=0)
> compiler: clang version 17.0.0
> (https://git/
> hub.com%2Fllvm%2Fllvm-project.git&data=05%7C01%7CSteven.French%40micro
> soft.com%7Cb15fd25d8a424332574308db8ec022d5%7C72f988bf86f141af91ab2d7c
> d011db47%7C1%7C0%7C638260728110528650%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7
> C%7C&sdata=m%2BNLdUsC7MNxn5YoYWroka3ANYO7CaMmQXCl2vVnoyU%3D&reserved=0
> 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce:
> (https://dow/
> nload.01.org%2F0day-ci%2Farchive%2F20230727%2F202307270640.5ODmPwDl-lk
> p%40intel.com%2Freproduce&data=05%7C01%7CSteven.French%40microsoft.com
> %7Cb15fd25d8a424332574308db8ec022d5%7C72f988bf86f141af91ab2d7cd011db47
> %7C1%7C0%7C638260728110528650%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda
> ta=iFqAsjC5UOLz42Hhh4iM31%2BS7F1TAtLoreO9LbeK3tI%3D&reserved=0)
>
> 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 <lkp@intel.com>
> | Closes:
> | https://lore/
> | .kernel.org%2Foe-kbuild-all%2F202307270640.5ODmPwDl-lkp%40intel.com%
> | 2F
> | &data=05%7C01%7CSteven.French%40microsoft.com%7C2cc584fd937a4cd5b9d0
> | 08
> | db8e29f75b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638260083130
> | 23
> | 4737%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> | BT
> | iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AauGIxZRPM5DK1J5j6ly
> | Ep
> | jOkArxfVtIUAnmPcxcCQs%3D&reserved=0
>
> All warnings (new ones prefixed by >>):
>
> >> fs/smb/client/sess.c:160:5: warning: stack frame size (1152)
> >> exceeds limit (1024) in 'cifs_try_adding_channels'
> >> [-Wframe-larger-than]
>      160 | int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
>          |     ^
>    1 warning generated.
>
>
> vim +/cifs_try_adding_channels +160 fs/smb/client/sess.c
>
> b54034a73baf9f fs/cifs/sess.c Shyam Prasad N  2022-01-03  158
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  159  /*
> returns number of channels added */ 387ec58f339b0c fs/cifs/sess.c
> Ronnie Sahlberg 2020-12-14 @160  int cifs_try_adding_channels(struct
> cifs_sb_info *cifs_sb, struct cifs_ses *ses)
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  161  {
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  162   struct TCP_Server_Info *server = ses->server;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  163   int old_chan_count, new_chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  164   int left;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  165   int rc = 0;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  166   int tries = 0;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  167   struct cifs_server_iface *iface = NULL, *niface = NULL;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  168
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  169   spin_lock(&ses->chan_lock);
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  170
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  171   new_chan_count = old_chan_count = ses->chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  172   left = ses->chan_max - ses->chan_count;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  173
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  174   if (left <= 0) {
> 88b024f556fcd5 fs/cifs/sess.c Shyam Prasad N  2021-11-19  175           spin_unlock(&ses->chan_lock);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  176           cifs_dbg(FYI,
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  177                    "ses already at max_channels (%zu), nothing to open\n",
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  178                    ses->chan_max);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  179           return 0;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  180   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  181
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  182   if (server->dialect < SMB30_PROT_ID) {
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  183           spin_unlock(&ses->chan_lock);
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  184           cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  185           return 0;
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  186   }
> 53923e0fe2098f fs/cifs/sess.c Steve French    2022-02-16  187
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  188   if (!(server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  189           ses->chan_max = 1;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  190           spin_unlock(&ses->chan_lock);
> 90c49fce1c43e1 fs/cifs/sess.c Paulo Alcantara 2023-04-21  191           cifs_server_dbg(VFS, "no multichannel support\n");
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  192           return 0;
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  193   }
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  194   spin_unlock(&ses->chan_lock);
> 9c2dc11df50d1c fs/cifs/sess.c Steve French    2021-05-07  195
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  196   /*
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  197    * Keep connecting to same, fastest, iface for all channels as
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  198    * long as its RSS. Try next fastest one if not RSS or channel
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  199    * creation fails.
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  200    */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  201   spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  202   iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  203                            iface_head);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  204   spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  205
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  206   while (left > 0) {
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  207
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  208           tries++;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  209           if (tries > 3*ses->chan_max) {
> bbbf9eafbfdaa2 fs/cifs/sess.c Steve French    2020-05-30  210                   cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n",
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  211                            left);
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  212                   break;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  213           }
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  214
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  215           spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  216           if (!ses->iface_count) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  217                   spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  218                   break;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  219           }
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  220
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  221           list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  222                               iface_head) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  223                   /* skip ifaces that are unusable */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  224                   if (!iface->is_active ||
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  225                       (is_ses_using_iface(ses, iface) &&
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  226                        !iface->rss_capable)) {
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  227                           continue;
> 65a37a34145ca6 fs/cifs/sess.c Aurelien Aptel  2019-11-20  228                   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  229
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  230                   /* take ref before unlock */
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  231                   kref_get(&iface->refcount);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  232
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  233                   spin_unlock(&ses->iface_lock);
> 387ec58f339b0c fs/cifs/sess.c Ronnie Sahlberg 2020-12-14  234                   rc = cifs_ses_add_channel(cifs_sb, ses, iface);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  235                   spin_lock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  236
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  237                   if (rc) {
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  238                           cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  239                                    &iface->sockaddr,
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  240                                    rc);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  241                           kref_put(&iface->refcount, release_iface);
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  242                           continue;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  243                   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  244
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  245                   cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n",
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  246                            &iface->sockaddr);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  247                   break;
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  248           }
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  249           spin_unlock(&ses->iface_lock);
> aa45dadd34e44f fs/cifs/sess.c Shyam Prasad N  2022-01-01  250
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  251           left--;
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  252           new_chan_count++;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  253   }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  254
> 724244cdb38285 fs/cifs/sess.c Shyam Prasad N  2021-07-19  255   return new_chan_count - old_chan_count;
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  256  }
> d70e9fa5588476 fs/cifs/sess.c Aurelien Aptel  2019-09-20  257
>
> :::::: The code at line 160 was first introduced by commit
> :::::: 387ec58f339b0c45e3767395f11fa8dd3772131e cifs: simplify
> handling of cifs_sb/ctx->local_nls
>
> :::::: TO: Ronnie Sahlberg <lsahlber@redhat.com>
> :::::: CC: Steve French <stfrench@microsoft.com>
>
> --
> 0-DAY CI Kernel Test Service
> https://gith/
> ub.com%2Fintel%2Flkp-tests%2Fwiki&data=05%7C01%7CSteven.French%40microsoft.com%7Cb15fd25d8a424332574308db8ec022d5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638260728110528650%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=kSq8AIXuw4aqvh6X7af5shWbFVmIVgXpBpiLJEuKReE%3D&reserved=0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-27 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 22:43 fs/smb/client/sess.c:160:5: warning: stack frame size (1152) exceeds limit (1024) in 'cifs_try_adding_channels' kernel test robot
2023-07-27  3:36 ` [EXTERNAL] " Steven French
2023-07-27 16:40   ` Nathan Chancellor
2023-07-27 18:32     ` Steven French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).