All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Cc: martin.petersen@oracle.com, hare@suse.de, jejb@linux.ibm.com,
	mlombard@redhat.com, michael.christie@oracle.com,
	bvanassche@acm.org, houpu@bytedance.com,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH 00/23] target: code cleanup
Date: Sat, 27 Feb 2021 21:56:22 -0800	[thread overview]
Message-ID: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> (raw)

Hi,

This removes unused macros, various memset, extra variable in the 
target/iblock for bio get and fixes type mismatch for the same.

The unused macros warning are found at compile time and they are
documented in each patch commit log. For memset removal, there are no
warnings.

First four patches are target_core_iblock.c cleanup. The next six
patches are removal of the unused macros followed by elevan patches to 
remove the memset for local array buffers. The last patch is for
removing the duplicate memset to initialize the buffer to 0xff.
 
I've tested this patch series with creating target bdev backend with
loop back transport, fio verification job seems to work fine.

Any feedback is welcome.

This is generated on today's linux-block for-next.

-ck

Chaitanya Kulkarni (23):
  target/iblock: remove an extra argument
  target/iblock: trim down line longer than 80 char
  target/iblock: fix the type of the logs_per_phys
  targe/pscsi: fix the warning in pscsi_complete_cmd
  target/sbc: get rid of the warning in cmp & write
  target/pscsi: remove unsed macro ISPRINT
  target/stat: remove unsed macro ISPRINT
  target/stat: remove unsed macro NONE
  target/stat: remove unsed macro
  target/iscsi: remove unsed macro TEXT_LEN
  target/iscsi: remove unsed macro PRINT_BUF
  target/iscsi: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/configfs: remove the memset with declare-init
  target/pr: remove the memset with declare-init
  target/pr: remove the memset with declare-init
  target/pr: remove the memset with declare-init
  target/core: don't duplicate memset 0xff

 drivers/target/iscsi/iscsi_target_configfs.c |  3 +-
 drivers/target/iscsi/iscsi_target_nego.c     |  1 -
 drivers/target/iscsi/iscsi_target_stat.c     |  1 -
 drivers/target/iscsi/iscsi_target_util.c     | 17 ---------
 drivers/target/target_core_configfs.c        | 25 ++++---------
 drivers/target/target_core_file.c            |  3 +-
 drivers/target/target_core_iblock.c          | 37 ++++++++++----------
 drivers/target/target_core_pr.c              | 36 +++++++------------
 drivers/target/target_core_pscsi.c           |  5 ++-
 drivers/target/target_core_sbc.c             |  4 +--
 drivers/target/target_core_stat.c            |  3 --
 11 files changed, 45 insertions(+), 90 deletions(-)

Test log for fio verification job with bdev backend with loop transport:-
# ./create_lio.sh 
+ targetcli clearconfig confirm=True
+ clear_dmesg
All configuration cleared
+ rmdir config/target/iscsi
+ rmdir config/target/loopback
+ modprobe -r iscsi_target_mod
+ modprobe -r tcm_loop
+ modprobe -r target_core_file
+ modprobe -r target_core_pscsi
+ modprobe -r target_core_iblock
+ modprobe -r target_core_user
+ modprobe -r target_core_mod
+ lsmod
+ grep target
++ nproc
+ make -j 64 M=drivers/target modules
+ TARGET=drivers/target
++ uname -r
+ TARGET_DEST=/lib/modules/5.11.0blk+/kernel/drivers/target/
+ TARGET_LOOPBACK=drivers/target/loopback
++ uname -r
+ TARGET_LOOPBACK_DEST=/lib/modules/5.11.0blk+/kernel/drivers/target/loopback
+ TARGET_ISCSI=drivers/target/iscsi/
++ uname -r
+ TARGET_ISCSI_DEST=/lib/modules/5.11.0blk+/kernel/drivers/target/iscsi
+ cp drivers/target/target_core_file.ko drivers/target/target_core_iblock.ko drivers/target/target_core_mod.ko drivers/target/target_core_pscsi.ko drivers/target/target_core_user.ko /lib/modules/5.11.0blk+/kernel/drivers/target//
+ cp drivers/target/loopback/tcm_loop.ko /lib/modules/5.11.0blk+/kernel/drivers/target/loopback/
+ cp drivers/target/iscsi//iscsi_target_mod.ko /lib/modules/5.11.0blk+/kernel/drivers/target/iscsi/
+ find /lib/modules/5.11.0blk+/kernel/drivers/target/ -name '*ko'
+ xargs ls -l
-rw-r--r--. 1 root root 3650814 Feb 27 18:32 /lib/modules/5.11.0blk+/kernel/drivers/target/iscsi/cxgbit/cxgbit.ko
-rw-r--r--. 1 root root 9502192 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/iscsi/iscsi_target_mod.ko
-rw-r--r--. 1 root root 9502192 Feb 27 21:02 /lib/modules/5.11.0blk+/kernel/drivers/target/loopback/iscsi_target_mod.ko
-rw-r--r--. 1 root root  610912 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/loopback/tcm_loop.ko
-rw-r--r--. 1 root root  554664 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/target_core_file.ko
-rw-r--r--. 1 root root  573760 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/target_core_iblock.ko
-rw-r--r--. 1 root root 9450112 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/target_core_mod.ko
-rw-r--r--. 1 root root  626880 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/target_core_pscsi.ko
-rw-r--r--. 1 root root 1044992 Feb 27 21:15 /lib/modules/5.11.0blk+/kernel/drivers/target/target_core_user.ko
-rw-r--r--. 1 root root 1808854 Feb 27 18:32 /lib/modules/5.11.0blk+/kernel/drivers/target/tcm_fc/tcm_fc.ko
+ modprobe target_core_file
+ modprobe target_core_pscsi
+ modprobe target_core_iblock
+ modprobe target_core_user
+ modprobe target_core_mod
+ lsmod
+ grep target_core
target_core_user       57344  0 
uio                    24576  1 target_core_user
target_core_iblock     28672  0 
target_core_pscsi      28672  0 
target_core_file       28672  0 
target_core_mod       450560  4 target_core_file,target_core_iblock,target_core_pscsi,target_core_user
+ tree config/target
config/target
├── core
│   └── alua
│       └── lu_gps
│           └── default_lu_gp
│               ├── lu_gp_id
│               └── members
├── dbroot
└── version

4 directories, 4 files
+ targetcli restoreconfig ./lio.json
Configuration restored, 2 recoverable errors:
Storage Object block/bdev: Cannot set attribute alua_support: [Errno 22] Invalid argument, skipped
Storage Object block/bdev: Cannot set attribute pgr_support: [Errno 22] Invalid argument, skipped
+ lsscsi
[0:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdc 
[0:0:1:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdd 
[1:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sda 
[1:0:1:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdb 
[2:0:1:0]    disk    LIO-ORG  bdev             4.0   /dev/sde 
# 
# 
# 
# cat fio/verify.fio 
[write-and-verify]
rw=randwrite
bs=4k
direct=1
ioengine=libaio
iodepth=16
norandommap
randrepeat=0
verify=crc32c
size=500m
group_reporting
# lsblk | grep sde 
sde                 8:64   0    2G  0 disk 
# fio fio/verify.fio --filename=/dev/sde
write-and-verify: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=16
fio-3.8-5-g464b
Starting 1 process
Jobs: 1 (f=1): [V(1)][84.6%][r=81.2MiB/s,w=0KiB/s][r=20.8k,w=0 IOPS][eta 00m:02s]      
write-and-verify: (groupid=0, jobs=1): err= 0: pid=20096: Sat Feb 27 21:17:35 2021
   read: IOPS=21.3k, BW=83.3MiB/s (87.4MB/s)(316MiB/3796msec)
    slat (usec): min=9, max=348, avg=11.37, stdev= 4.64
    clat (usec): min=138, max=1946, avg=737.14, stdev=199.40
     lat (usec): min=208, max=2273, avg=748.62, stdev=202.00
    clat percentiles (usec):
     |  1.00th=[  490],  5.00th=[  502], 10.00th=[  519], 20.00th=[  701],
     | 30.00th=[  709], 40.00th=[  717], 50.00th=[  725], 60.00th=[  725],
     | 70.00th=[  725], 80.00th=[  734], 90.00th=[  750], 95.00th=[ 1352],
     | 99.00th=[ 1549], 99.50th=[ 1598], 99.90th=[ 1844], 99.95th=[ 1876],
     | 99.99th=[ 1926]
  write: IOPS=17.0k, BW=70.2MiB/s (73.6MB/s)(500MiB/7123msec)
    slat (usec): min=10, max=420, avg=13.99, stdev= 5.67
    clat (usec): min=103, max=2436, avg=875.65, stdev=233.59
     lat (usec): min=116, max=2508, avg=889.75, stdev=236.91
    clat percentiles (usec):
     |  1.00th=[  498],  5.00th=[  611], 10.00th=[  709], 20.00th=[  791],
     | 30.00th=[  807], 40.00th=[  816], 50.00th=[  824], 60.00th=[  832],
     | 70.00th=[  848], 80.00th=[  906], 90.00th=[  996], 95.00th=[ 1516],
     | 99.00th=[ 1795], 99.50th=[ 1876], 99.90th=[ 2073], 99.95th=[ 2147],
     | 99.99th=[ 2343]
   bw (  KiB/s): min=16864, max=90064, per=94.95%, avg=68247.93, stdev=15516.59, samples=15
   iops        : min= 4216, max=22516, avg=17061.93, stdev=3879.14, samples=15
  lat (usec)   : 250=0.01%, 500=2.09%, 750=40.08%, 1000=49.07%
  lat (msec)   : 2=8.63%, 4=0.13%
  cpu          : usr=5.50%, sys=26.40%, ctx=13071, majf=0, minf=1913
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=100.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=80978,128000,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
   READ: bw=83.3MiB/s (87.4MB/s), 83.3MiB/s-83.3MiB/s (87.4MB/s-87.4MB/s), io=316MiB (332MB), run=3796-3796msec
  WRITE: bw=70.2MiB/s (73.6MB/s), 70.2MiB/s-70.2MiB/s (73.6MB/s-73.6MB/s), io=500MiB (524MB), run=7123-7123msec

Disk stats (read/write):
  sde: ios=78668/128000, merge=0/0, ticks=47413/92827, in_queue=140240, util=99.16%
# targetcli clearconfig confirm=True
All configuration cleared
#
-- 
2.22.1


             reply	other threads:[~2021-02-28  5:58 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28  5:56 Chaitanya Kulkarni [this message]
2021-02-28  5:56 ` [PATCH 01/23] target/iblock: remove an extra argument Chaitanya Kulkarni
2021-03-01 10:40   ` Johannes Thumshirn
2021-03-09 17:15   ` Bart Van Assche
2021-02-28  5:56 ` [PATCH 02/23] target/iblock: trim down line longer than 80 char Chaitanya Kulkarni
2021-03-01 10:41   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 03/23] target/iblock: fix the type of the logs_per_phys Chaitanya Kulkarni
2021-03-01 10:45   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 04/23] targe/pscsi: fix the warning in pscsi_complete_cmd Chaitanya Kulkarni
2021-03-01 12:30   ` Johannes Thumshirn
2021-03-02  3:57     ` Chaitanya Kulkarni
2021-02-28  5:56 ` [PATCH 05/23] target/sbc: get rid of the warning in cmp & write Chaitanya Kulkarni
2021-03-01 12:51   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 06/23] target/pscsi: remove unsed macro ISPRINT Chaitanya Kulkarni
2021-03-01 12:56   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 07/23] target/stat: " Chaitanya Kulkarni
2021-03-01 12:56   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 08/23] target/stat: remove unsed macro NONE Chaitanya Kulkarni
2021-03-01 12:57   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 09/23] target/stat: remove unsed macro Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 10/23] target/iscsi: remove unsed macro TEXT_LEN Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 11/23] target/iscsi: remove unsed macro PRINT_BUF Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 12/23] target/iscsi: remove the memset with declare-init Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 13/23] target/configfs: " Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 14/23] " Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 15/23] " Chaitanya Kulkarni
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 16/23] " Chaitanya Kulkarni
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 17/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 18/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 19/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 20/23] target/pr: " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 21/23] " Chaitanya Kulkarni
2021-03-01 13:02   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 22/23] " Chaitanya Kulkarni
2021-03-01 13:02   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 23/23] target/core: don't duplicate memset 0xff Chaitanya Kulkarni
2021-03-01 13:05   ` Johannes Thumshirn
2021-02-28 20:13 ` [PATCH 00/23] target: code cleanup michael.christie
2021-03-01  0:06   ` Chaitanya Kulkarni
2021-03-09  5:04 ` Chaitanya Kulkarni
2021-03-09 17:15   ` Bart Van Assche
2021-03-10  4:32 ` Martin K. Petersen
2021-03-16  3:14 ` Martin K. Petersen

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=20210228055645.22253-1-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=houpu@bytedance.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mlombard@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /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.