All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Prakash Sangappa <prakash.sangappa@oracle.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [RESEND RFC PATCH 1/3] Introduce per thread user-kernel shared structure
Date: Fri, 10 Sep 2021 01:27:01 +0800	[thread overview]
Message-ID: <202109100149.Refp6Roi-lkp@intel.com> (raw)
In-Reply-To: <1631147036-13597-2-git-send-email-prakash.sangappa@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 5720 bytes --]

Hi Prakash,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on v5.14]
[cannot apply to tip/sched/core hnaz-linux-mm/master linus/master tip/x86/asm next-20210909]
[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]

url:    https://github.com/0day-ci/linux/commits/Prakash-Sangappa/Provide-fast-access-to-thread-specific-data/20210909-081749
base:    7d2a07b769330c34b4deabeed939325c77a7ec2f
config: hexagon-randconfig-r036-20210908 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
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
        # https://github.com/0day-ci/linux/commit/06c86997c20b19402390733cbb6b96acc3f9cf3b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prakash-Sangappa/Provide-fast-access-to-thread-specific-data/20210909-081749
        git checkout 06c86997c20b19402390733cbb6b96acc3f9cf3b
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   mm/task_shared.c:264:1: warning: unused label 'out' [-Wunused-label]
   out:
   ^~~~
>> mm/task_shared.c:298:1: error: conflicting types for 'sys_task_getshared'
   SYSCALL_DEFINE3(task_getshared, u64, opt, u64, flags, void __user *, uaddr)
   ^
   include/linux/syscalls.h:218:36: note: expanded from macro 'SYSCALL_DEFINE3'
   #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
                                      ^
   include/linux/syscalls.h:227:2: note: expanded from macro 'SYSCALL_DEFINEx'
           __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
           ^
   include/linux/syscalls.h:241:18: note: expanded from macro '__SYSCALL_DEFINEx'
           asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))       \
                           ^
   <scratch space>:129:1: note: expanded from here
   sys_task_getshared
   ^
   include/linux/syscalls.h:1055:17: note: previous declaration is here
   asmlinkage long sys_task_getshared(long opt, long flags, void __user *uaddr);
                   ^
   1 warning and 1 error generated.


vim +/sys_task_getshared +298 mm/task_shared.c

   200	
   201	
   202	/*
   203	 * Allocate task_ushared struct for calling thread.
   204	 */
   205	static int task_ushared_alloc(void)
   206	{
   207		struct mm_struct *mm = current->mm;
   208		struct ushared_pg *ent = NULL;
   209		struct task_ushrd_struct *ushrd;
   210		struct ushared_pages *usharedpg;
   211		int tryalloc = 0;
   212		int slot = -1;
   213		int ret = -ENOMEM;
   214	
   215		if (mm->usharedpg == NULL && init_mm_ushared(mm))
   216			return ret;
   217	
   218		if (current->task_ushrd == NULL && init_task_ushrd(current))
   219			return ret;
   220	
   221		usharedpg = mm->usharedpg;
   222		ushrd = current->task_ushrd;
   223	repeat:
   224		if (mmap_write_lock_killable(mm))
   225			return -EINTR;
   226	
   227		ent = list_empty(&usharedpg->frlist) ? NULL :
   228			list_entry(usharedpg->frlist.next,
   229			struct ushared_pg, fr_list);
   230	
   231		if (ent == NULL || ent->slot_count == 0) {
   232			if (tryalloc == 0) {
   233				mmap_write_unlock(mm);
   234				(void)ushared_allocpg();
   235				tryalloc = 1;
   236				goto repeat;
   237			} else {
   238				ent = NULL;
   239			}
   240		}
   241	
   242		if (ent) {
   243			slot = find_first_zero_bit((unsigned long *)(&ent->bitmap),
   244			  TASK_USHARED_SLOTS);
   245			BUG_ON(slot >=  TASK_USHARED_SLOTS);
   246	
   247			set_bit(slot, (unsigned long *)(&ent->bitmap));
   248	
   249			ushrd->uaddr = (struct task_ushared *)(ent->vaddr +
   250			  (slot * sizeof(union task_shared)));
   251			ushrd->kaddr = (struct task_ushared *)(ent->kaddr +
   252			  (slot * sizeof(union task_shared)));
   253			ushrd->upg = ent;
   254			ent->slot_count--;
   255			/* move it to tail */
   256			if (ent->slot_count == 0) {
   257				list_del(&ent->fr_list);
   258				list_add_tail(&ent->fr_list, &usharedpg->frlist);
   259			}
   260	
   261		       ret = 0;
   262		}
   263	
 > 264	out:
   265		mmap_write_unlock(mm);
   266		return ret;
   267	}
   268	
   269	
   270	/*
   271	 * Task Shared : allocate if needed, and return address of shared struct for
   272	 * this thread/task.
   273	 */
   274	static long task_getshared(u64 opt, u64 flags, void __user *uaddr)
   275	{
   276		struct task_ushrd_struct *ushrd = current->task_ushrd;
   277	
   278		/* We have address, return. */
   279		if (ushrd != NULL && ushrd->upg != NULL) {
   280			if (copy_to_user(uaddr, &ushrd->uaddr,
   281				sizeof(struct task_ushared *)))
   282				return (-EFAULT);
   283			return 0;
   284		}
   285	
   286		task_ushared_alloc();
   287		ushrd = current->task_ushrd;
   288		if (ushrd != NULL && ushrd->upg != NULL) {
   289			if (copy_to_user(uaddr, &ushrd->uaddr,
   290				sizeof(struct task_ushared *)))
   291				return (-EFAULT);
   292			return 0;
   293		}
   294		return (-ENOMEM);
   295	}
   296	
   297	
 > 298	SYSCALL_DEFINE3(task_getshared, u64, opt, u64, flags, void __user *, uaddr)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27799 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RESEND RFC PATCH 1/3] Introduce per thread user-kernel shared structure
Date: Fri, 10 Sep 2021 01:27:01 +0800	[thread overview]
Message-ID: <202109100149.Refp6Roi-lkp@intel.com> (raw)
In-Reply-To: <1631147036-13597-2-git-send-email-prakash.sangappa@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 5880 bytes --]

Hi Prakash,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on v5.14]
[cannot apply to tip/sched/core hnaz-linux-mm/master linus/master tip/x86/asm next-20210909]
[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]

url:    https://github.com/0day-ci/linux/commits/Prakash-Sangappa/Provide-fast-access-to-thread-specific-data/20210909-081749
base:    7d2a07b769330c34b4deabeed939325c77a7ec2f
config: hexagon-randconfig-r036-20210908 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
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
        # https://github.com/0day-ci/linux/commit/06c86997c20b19402390733cbb6b96acc3f9cf3b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prakash-Sangappa/Provide-fast-access-to-thread-specific-data/20210909-081749
        git checkout 06c86997c20b19402390733cbb6b96acc3f9cf3b
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   mm/task_shared.c:264:1: warning: unused label 'out' [-Wunused-label]
   out:
   ^~~~
>> mm/task_shared.c:298:1: error: conflicting types for 'sys_task_getshared'
   SYSCALL_DEFINE3(task_getshared, u64, opt, u64, flags, void __user *, uaddr)
   ^
   include/linux/syscalls.h:218:36: note: expanded from macro 'SYSCALL_DEFINE3'
   #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
                                      ^
   include/linux/syscalls.h:227:2: note: expanded from macro 'SYSCALL_DEFINEx'
           __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
           ^
   include/linux/syscalls.h:241:18: note: expanded from macro '__SYSCALL_DEFINEx'
           asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))       \
                           ^
   <scratch space>:129:1: note: expanded from here
   sys_task_getshared
   ^
   include/linux/syscalls.h:1055:17: note: previous declaration is here
   asmlinkage long sys_task_getshared(long opt, long flags, void __user *uaddr);
                   ^
   1 warning and 1 error generated.


vim +/sys_task_getshared +298 mm/task_shared.c

   200	
   201	
   202	/*
   203	 * Allocate task_ushared struct for calling thread.
   204	 */
   205	static int task_ushared_alloc(void)
   206	{
   207		struct mm_struct *mm = current->mm;
   208		struct ushared_pg *ent = NULL;
   209		struct task_ushrd_struct *ushrd;
   210		struct ushared_pages *usharedpg;
   211		int tryalloc = 0;
   212		int slot = -1;
   213		int ret = -ENOMEM;
   214	
   215		if (mm->usharedpg == NULL && init_mm_ushared(mm))
   216			return ret;
   217	
   218		if (current->task_ushrd == NULL && init_task_ushrd(current))
   219			return ret;
   220	
   221		usharedpg = mm->usharedpg;
   222		ushrd = current->task_ushrd;
   223	repeat:
   224		if (mmap_write_lock_killable(mm))
   225			return -EINTR;
   226	
   227		ent = list_empty(&usharedpg->frlist) ? NULL :
   228			list_entry(usharedpg->frlist.next,
   229			struct ushared_pg, fr_list);
   230	
   231		if (ent == NULL || ent->slot_count == 0) {
   232			if (tryalloc == 0) {
   233				mmap_write_unlock(mm);
   234				(void)ushared_allocpg();
   235				tryalloc = 1;
   236				goto repeat;
   237			} else {
   238				ent = NULL;
   239			}
   240		}
   241	
   242		if (ent) {
   243			slot = find_first_zero_bit((unsigned long *)(&ent->bitmap),
   244			  TASK_USHARED_SLOTS);
   245			BUG_ON(slot >=  TASK_USHARED_SLOTS);
   246	
   247			set_bit(slot, (unsigned long *)(&ent->bitmap));
   248	
   249			ushrd->uaddr = (struct task_ushared *)(ent->vaddr +
   250			  (slot * sizeof(union task_shared)));
   251			ushrd->kaddr = (struct task_ushared *)(ent->kaddr +
   252			  (slot * sizeof(union task_shared)));
   253			ushrd->upg = ent;
   254			ent->slot_count--;
   255			/* move it to tail */
   256			if (ent->slot_count == 0) {
   257				list_del(&ent->fr_list);
   258				list_add_tail(&ent->fr_list, &usharedpg->frlist);
   259			}
   260	
   261		       ret = 0;
   262		}
   263	
 > 264	out:
   265		mmap_write_unlock(mm);
   266		return ret;
   267	}
   268	
   269	
   270	/*
   271	 * Task Shared : allocate if needed, and return address of shared struct for
   272	 * this thread/task.
   273	 */
   274	static long task_getshared(u64 opt, u64 flags, void __user *uaddr)
   275	{
   276		struct task_ushrd_struct *ushrd = current->task_ushrd;
   277	
   278		/* We have address, return. */
   279		if (ushrd != NULL && ushrd->upg != NULL) {
   280			if (copy_to_user(uaddr, &ushrd->uaddr,
   281				sizeof(struct task_ushared *)))
   282				return (-EFAULT);
   283			return 0;
   284		}
   285	
   286		task_ushared_alloc();
   287		ushrd = current->task_ushrd;
   288		if (ushrd != NULL && ushrd->upg != NULL) {
   289			if (copy_to_user(uaddr, &ushrd->uaddr,
   290				sizeof(struct task_ushared *)))
   291				return (-EFAULT);
   292			return 0;
   293		}
   294		return (-ENOMEM);
   295	}
   296	
   297	
 > 298	SYSCALL_DEFINE3(task_getshared, u64, opt, u64, flags, void __user *, uaddr)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27799 bytes --]

  parent reply	other threads:[~2021-09-09 17:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  0:23 [RESEND RFC PATCH 0/3] Provide fast access to thread specific data Prakash Sangappa
2021-09-09  0:23 ` [RESEND RFC PATCH 1/3] Introduce per thread user-kernel shared structure Prakash Sangappa
2021-09-09  1:50   ` Jann Horn
2021-09-09 17:30     ` Prakash Sangappa
2021-09-09 17:27   ` kernel test robot [this message]
2021-09-09 17:27     ` kernel test robot
2021-09-09  0:23 ` [RESEND RFC PATCH 2/3] Publish tasks's scheduler stats thru the " Prakash Sangappa
2021-09-09 12:41   ` kernel test robot
2021-09-09 12:41     ` kernel test robot
2021-09-09  0:23 ` [RESEND RFC PATCH 3/3] Introduce task's 'off cpu' time Prakash Sangappa
     [not found] ` <CAFTs51VDUPWu=r9d=ThABc-Z6wCwTOC+jKDCq=Jk8Pfid61xyQ@mail.gmail.com>
2021-09-10 15:18   ` Fwd: [RESEND RFC PATCH 0/3] Provide fast access to thread specific data Peter Oskolkov
2021-09-10 16:13     ` Prakash Sangappa
2021-09-10 16:28       ` Peter Oskolkov
2021-09-10 19:12         ` Jann Horn
2021-09-10 19:36           ` Peter Oskolkov
2021-09-13 17:36             ` Prakash Sangappa
2021-09-13 18:00               ` Peter Oskolkov
2021-09-14 16:10                 ` Prakash Sangappa
2021-09-10 16:37     ` Fwd: " Florian Weimer
2021-09-10 17:33       ` Mathieu Desnoyers
2021-09-10 17:48         ` Peter Oskolkov
2021-09-10 17:55           ` Mathieu Desnoyers
2021-09-10 18:00             ` Peter Oskolkov
  -- strict thread matches above, loose matches on Subject: below --
2021-09-09  0:10 Prakash Sangappa
2021-09-09  0:10 ` [RESEND RFC PATCH 1/3] Introduce per thread user-kernel shared structure Prakash Sangappa
2021-09-09  6:39   ` Greg KH
2021-09-09 18:45     ` Prakash Sangappa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202109100149.Refp6Roi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@lists.linux.dev \
    --cc=prakash.sangappa@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.