Message ID | 20211221065047.290182-1-mike.ximing.chen@intel.com (mailing list archive) |
---|---|
Headers | show |
Series | dlb: introduce DLB device driver | expand |
On Tue, Dec 21, 2021 at 12:50:30AM -0600, Mike Ximing Chen wrote: > v12: <snip> How is a "RFC" series on version 12? "RFC" means "I do not think this should be merged, please give me some comments on how this is all structured" which I think is not the case here. > - The following coding style changes suggested by Dan will be implemented > in the next revision > -- Replace DLB_CSR_RD() and DLB_CSR_WR() with direct ioread32() and > iowrite32() call. > -- Remove bitmap wrappers and use linux bitmap functions directly. > -- Use trace_event in configfs attribute file update. Why submit a patch series that you know will be changed? Just do the work, don't ask anyone to review stuff you know is incorrect, that just wastes our time and ensures that we never want to review it again. greg k-h
> 1. Before a scheduling domain is created/enabled, a set of parameters are > passed to the kernel driver via configfs attribute files in an configfs domain > directory (say $domain) created by user. Each attribute file corresponds to > a configuration parameter of the domain. After writing to all the attribute > files, user writes 1 to "create" attribute, which triggers an action (i.e., > domain creation) in the kernel driver. Since multiple processes/users can > access the $domain directory, multiple users can write to the attribute files > at the same time. How do we guarantee an atomic update/configuration of a > domain? In other words, if user A wants to set attributes 1 and 2, how can we > prevent user B from changing attribute 1 and 2 before user A writes 1 to > "create"? A configfs directory with individual attribute files seems to not > be able to provide atomic configuration in this case. One option to solve this > issue could be write a structured data (with a set of parameters) to a single > attribute file. This would guarantee the atomic configuration, but may not be > a conventional configfs operation. How about throw away configfs and use netlink? Messages are atomic, and you can add an arbitrary number of attributes to a single netlink message. It will also make your code more network like, since nothing else in the network stack uses configfs, as far as i know. Andrew
> -----Original Message----- > From: Greg KH <gregkh@linuxfoundation.org> > Sent: Tuesday, December 21, 2021 2:10 AM > To: Chen, Mike Ximing <mike.ximing.chen@intel.com> > Cc: linux-kernel@vger.kernel.org; arnd@arndb.de; Williams, Dan J <dan.j.williams@intel.com>; pierre- > louis.bossart@linux.intel.com; netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org > Subject: Re: [RFC PATCH v12 00/17] dlb: introduce DLB device driver > > On Tue, Dec 21, 2021 at 12:50:30AM -0600, Mike Ximing Chen wrote: > > v12: > > <snip> > > How is a "RFC" series on version 12? "RFC" means "I do not think this should be merged, please give me > some comments on how this is all structured" which I think is not the case here. Hi Greg, "RFC" here means exactly what you referred to. As you know we have made many changes since your last review of the patch set (which was v10). At this point we are not sure if we are on the right track in terms of some configfs implementation, and would like some comments from the community. I stated this in the cover letter before the change log: " This submission is still a work in progress.... , a couple of issues that we would like to get help and suggestions from reviewers and community". I presented two issues/questions we are facing, and would like to get comments. The code on the other hand are tested and validated on our hardware platforms. I kept the version number in series (using v12, instead v1) so that reviewers can track the old submissions and have a better understanding of the patch set's history. > > > - The following coding style changes suggested by Dan will be implemented > > in the next revision > > -- Replace DLB_CSR_RD() and DLB_CSR_WR() with direct ioread32() and > > iowrite32() call. > > -- Remove bitmap wrappers and use linux bitmap functions directly. > > -- Use trace_event in configfs attribute file update. > > Why submit a patch series that you know will be changed? Just do the work, don't ask anyone to review > stuff you know is incorrect, that just wastes our time and ensures that we never want to review it again. > Since this is a RFC, and is not for merging or a full review, we though it was OK to log the pending coding style changes. The patch set was submitted and reviewed by the community before, and there was no complains on using macros like DLB_CSR_RD(), etc, but we think we can replace them for better readability of the code. Thanks Mike
On Tue, Dec 21, 2021 at 02:03:38PM +0000, Chen, Mike Ximing wrote: > > > -----Original Message----- > > From: Greg KH <gregkh@linuxfoundation.org> > > Sent: Tuesday, December 21, 2021 2:10 AM > > To: Chen, Mike Ximing <mike.ximing.chen@intel.com> > > Cc: linux-kernel@vger.kernel.org; arnd@arndb.de; Williams, Dan J <dan.j.williams@intel.com>; pierre- > > louis.bossart@linux.intel.com; netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org > > Subject: Re: [RFC PATCH v12 00/17] dlb: introduce DLB device driver > > > > On Tue, Dec 21, 2021 at 12:50:30AM -0600, Mike Ximing Chen wrote: > > > v12: > > > > <snip> > > > > How is a "RFC" series on version 12? "RFC" means "I do not think this should be merged, please give me > > some comments on how this is all structured" which I think is not the case here. > > Hi Greg, > > "RFC" here means exactly what you referred to. As you know we have made many changes since your > last review of the patch set (which was v10). At this point we are not sure if we are on the right track in > terms of some configfs implementation, and would like some comments from the community. I stated > this in the cover letter before the change log: " This submission is still a work in progress.... , a couple of > issues that we would like to get help and suggestions from reviewers and community". I presented two > issues/questions we are facing, and would like to get comments. > > The code on the other hand are tested and validated on our hardware platforms. I kept the version number > in series (using v12, instead v1) so that reviewers can track the old submissions and have a better > understanding of the patch set's history. "RFC" means "I have no idea if this is correct, I am throwing it out there and anyone who also cares about this type of thing, please comment". A patch that is on "RFC 12" means, "We all have no clue how to do this, we give up and hope you all will do it for us." I almost never comment on RFC patch series, except for portions of the kernel that I really care about. For a brand-new subsystem like this, that I still do not understand who needs it, that is not the case. I'm going to stop reviewing this patch series until you at least follow the Intel required rules for sending kernel patches like this out. To not do so would be unfair to your coworkers who _DO_ follow the rules. > > > - The following coding style changes suggested by Dan will be implemented > > > in the next revision > > > -- Replace DLB_CSR_RD() and DLB_CSR_WR() with direct ioread32() and > > > iowrite32() call. > > > -- Remove bitmap wrappers and use linux bitmap functions directly. > > > -- Use trace_event in configfs attribute file update. > > > > Why submit a patch series that you know will be changed? Just do the work, don't ask anyone to review > > stuff you know is incorrect, that just wastes our time and ensures that we never want to review it again. > > > Since this is a RFC, and is not for merging or a full review, we though it was OK to log the pending coding > style changes. The patch set was submitted and reviewed by the community before, and there was no > complains on using macros like DLB_CSR_RD(), etc, but we think we can replace them for better > readability of the code. Coding style changes should NEVER be ignored and put off for later. To do so means you do not care about the brains of anyone who you are wanting to read this code. We have a coding style because of brains and pattern matching, not because we are being mean. good luck, greg k-h
[ add Christoph for configfs feedback ] On Tue, Dec 21, 2021 at 7:03 AM Greg KH <gregkh@linuxfoundation.org> wrote: > > On Tue, Dec 21, 2021 at 02:03:38PM +0000, Chen, Mike Ximing wrote: > > > > > -----Original Message----- > > > From: Greg KH <gregkh@linuxfoundation.org> > > > Sent: Tuesday, December 21, 2021 2:10 AM > > > To: Chen, Mike Ximing <mike.ximing.chen@intel.com> > > > Cc: linux-kernel@vger.kernel.org; arnd@arndb.de; Williams, Dan J <dan.j.williams@intel.com>; pierre- > > > louis.bossart@linux.intel.com; netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org > > > Subject: Re: [RFC PATCH v12 00/17] dlb: introduce DLB device driver > > > > > > On Tue, Dec 21, 2021 at 12:50:30AM -0600, Mike Ximing Chen wrote: > > > > v12: > > > > > > <snip> > > > > > > How is a "RFC" series on version 12? "RFC" means "I do not think this should be merged, please give me > > > some comments on how this is all structured" which I think is not the case here. > > > > Hi Greg, > > > > "RFC" here means exactly what you referred to. As you know we have made many changes since your > > last review of the patch set (which was v10). At this point we are not sure if we are on the right track in > > terms of some configfs implementation, and would like some comments from the community. I stated > > this in the cover letter before the change log: " This submission is still a work in progress.... , a couple of > > issues that we would like to get help and suggestions from reviewers and community". I presented two > > issues/questions we are facing, and would like to get comments. > > > > The code on the other hand are tested and validated on our hardware platforms. I kept the version number > > in series (using v12, instead v1) so that reviewers can track the old submissions and have a better > > understanding of the patch set's history. > > "RFC" means "I have no idea if this is correct, I am throwing it out > there and anyone who also cares about this type of thing, please > comment". > > A patch that is on "RFC 12" means, "We all have no clue how to do this, > we give up and hope you all will do it for us." > > I almost never comment on RFC patch series, except for portions of the > kernel that I really care about. For a brand-new subsystem like this, > that I still do not understand who needs it, that is not the case. > > I'm going to stop reviewing this patch series until you at least follow > the Intel required rules for sending kernel patches like this out. To > not do so would be unfair to your coworkers who _DO_ follow the rules. > > > > > - The following coding style changes suggested by Dan will be implemented > > > > in the next revision > > > > -- Replace DLB_CSR_RD() and DLB_CSR_WR() with direct ioread32() and > > > > iowrite32() call. > > > > -- Remove bitmap wrappers and use linux bitmap functions directly. > > > > -- Use trace_event in configfs attribute file update. > > > > > > Why submit a patch series that you know will be changed? Just do the work, don't ask anyone to review > > > stuff you know is incorrect, that just wastes our time and ensures that we never want to review it again. > > > > > Since this is a RFC, and is not for merging or a full review, we though it was OK to log the pending coding > > style changes. The patch set was submitted and reviewed by the community before, and there was no > > complains on using macros like DLB_CSR_RD(), etc, but we think we can replace them for better > > readability of the code. > > Coding style changes should NEVER be ignored and put off for later. > To do so means you do not care about the brains of anyone who you are > wanting to read this code. We have a coding style because of brains and > pattern matching, not because we are being mean. Hey Greg, This is my fault. To date Mike has been patiently and diligently following my review feedback to continue to make the driver smaller and more Linux idiomatic. Primarily this has been ripping and replacing a pile of object configuration ioctls with configfs. While my confidence in that review feedback was high, my confidence in the current round of deeper architecture reworks is lower and they seemed to raise questions that are likely FAQs with using configfs. Specifically the observation that configfs, like sysfs, lacks an "atomically update multiple attributes" capability. To my knowledge that's just the expected tradeoff with pseudo-fs based configuration and it is up to userspace to coordinate multiple configuration writers. The other question is the use of anon_inode_getfd(). To me that mechanism is reserved for syscall and ioctl based architectures, and in this case it was only being used as a mechanism to get an automatic teardown action at process exit. Again, my inclination is that configs requires userspace to clean up anything it created. If "tear down on last close" behavior is needed that would either need to come from a userspace daemon to watch clients, or another character device that clients could open to represent the active users of the configuration. My preference is for the former. I green-lighted the work-in-progress / RFC posting (with the known style warts) to get momentum on just those questions. I thought it better to not polish this driver to a shine and get some mid-rework feedback. Mike continues to be a pleasure to work with, please take any frustrations on how this was presented out on me, I'll do better next time for these types of questions. DLB is unlike anything I have reviewed previously.
> Hey Greg, > > This is my fault. > > To date Mike has been patiently and diligently following my review > feedback to continue to make the driver smaller and more Linux > idiomatic. Primarily this has been ripping and replacing a pile of > object configuration ioctls with configfs. While my confidence in that > review feedback was high, my confidence in the current round of deeper > architecture reworks is lower and they seemed to raise questions that > are likely FAQs with using configfs. Specifically the observation that > configfs, like sysfs, lacks an "atomically update multiple attributes" > capability. To my knowledge that's just the expected tradeoff with > pseudo-fs based configuration and it is up to userspace to coordinate > multiple configuration writers. Hi Dan If this is considered a network accelerator, it probably should use the same configuration mechanisms all of networking uses, netlink. I'm not aware of anything network related using configfs, but it could exist. netlink messages should also solve your atomisity problem. But it does not really help with cleanup when the userspace user goes away. Is there anything from GPU drivers which can be reused? They must have some sort of cleanup when the user space DRM driver exits. Andrew
> -----Original Message----- > From: Andrew Lunn <andrew@lunn.ch> > Sent: Tuesday, December 21, 2021 4:41 AM > To: Chen, Mike Ximing <mike.ximing.chen@intel.com> > Cc: linux-kernel@vger.kernel.org; arnd@arndb.de; gregkh@linuxfoundation.org; Williams, Dan J > <dan.j.williams@intel.com>; pierre-louis.bossart@linux.intel.com; netdev@vger.kernel.org; > davem@davemloft.net; kuba@kernel.org > Subject: Re: [RFC PATCH v12 00/17] dlb: introduce DLB device driver > > > 1. Before a scheduling domain is created/enabled, a set of parameters > > are passed to the kernel driver via configfs attribute files in an > > configfs domain directory (say $domain) created by user. Each > > attribute file corresponds to a configuration parameter of the domain. > > After writing to all the attribute files, user writes 1 to "create" > > attribute, which triggers an action (i.e., domain creation) in the > > kernel driver. Since multiple processes/users can access the $domain > > directory, multiple users can write to the attribute files at the same > > time. How do we guarantee an atomic update/configuration of a domain? > > In other words, if user A wants to set attributes 1 and 2, how can we > > prevent user B from changing attribute 1 and 2 before user A writes 1 > > to "create"? A configfs directory with individual attribute files > > seems to not be able to provide atomic configuration in this case. One > > option to solve this issue could be write a structured data (with a > > set of parameters) to a single attribute file. This would guarantee the atomic configuration, but may not > be a conventional configfs operation. > > How about throw away configfs and use netlink? Messages are atomic, and you can add an arbitrary > number of attributes to a single netlink message. It will also make your code more network like, since > nothing else in the network stack uses configfs, as far as i know. > Hi Andrew, As I explained in my other response, DLB is not a network accelerator and DLB driver is not a part of network stack. We would obviously prefer to resolve the atomic update and resource reset at tear-down Issues within the configfs framework if possible. But I will take a look at the netlink implementations. Thanks for the suggestion Mike
On Tue, Dec 21, 2021 at 10:44:11AM -0800, Dan Williams wrote: > are likely FAQs with using configfs. Specifically the observation that > configfs, like sysfs, lacks an "atomically update multiple attributes" > capability. To my knowledge that's just the expected tradeoff with > pseudo-fs based configuration and it is up to userspace to coordinate > multiple configuration writers. Yes. For the SCSI and nvme targets we do a required attributes must be set before something can be enabled, but that might not work everywhere. > The other question is the use of anon_inode_getfd(). To me that > mechanism is reserved for syscall and ioctl based architectures, and It is. > in this case it was only being used as a mechanism to get an automatic > teardown action at process exit. Again, my inclination is that configs > requires userspace to clean up anything it created. If "tear down on > last close" behavior is needed that would either need to come from a > userspace daemon to watch clients, or another character device that > clients could open to represent the active users of the configuration. > My preference is for the former. This really sounds like configfs is the wrong interface. But I'd have to find time to see what dlb actually is before commenting on what might be a better interface.