You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/21 15:34:01 UTC

[GitHub] [incubator-nuttx] CV-Bowen opened a new pull request, #7642: fs_epoll: support extend the epoll dynamicly.

CV-Bowen opened a new pull request, #7642:
URL: https://github.com/apache/incubator-nuttx/pull/7642

   ## Summary
   1. epoll_ctl(EPOLL_CTL_ADD) support extend the epoll events dynamicly;
   2. enhance the epoll performance by moving some poll setup and teardown process to the EPOLL_CTL_ADD/DEL/MOD;
   
   ## Impact
   project uses epoll
   
   ## Testing
   sim with local testcases
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] CV-Bowen commented on a diff in pull request #7642: fs_epoll: support extend the epoll dynamicly.

Posted by GitBox <gi...@apache.org>.
CV-Bowen commented on code in PR #7642:
URL: https://github.com/apache/incubator-nuttx/pull/7642#discussion_r1028994210


##########
fs/vfs/fs_epoll.c:
##########
@@ -36,23 +36,45 @@
 #include <nuttx/clock.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/list.h>
 #include <nuttx/mutex.h>
+#include <nuttx/signal.h>
 
 #include "inode/inode.h"
 
 /****************************************************************************
  * Private Types
  ****************************************************************************/
 
-struct epoll_head
+typedef struct epoll_node_s
 {
-  int size;
-  int occupied;
-  int crefs;
-  mutex_t lock;
-  FAR epoll_data_t *data;
-  FAR struct pollfd *poll;
-};
+  struct list_node      node;
+  epoll_data_t          data;
+  struct pollfd         pfd;
+} epoll_node_t;

Review Comment:
   Done



##########
fs/vfs/fs_epoll.c:
##########
@@ -36,23 +36,45 @@
 #include <nuttx/clock.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/list.h>
 #include <nuttx/mutex.h>
+#include <nuttx/signal.h>
 
 #include "inode/inode.h"
 
 /****************************************************************************
  * Private Types
  ****************************************************************************/
 
-struct epoll_head
+typedef struct epoll_node_s
 {
-  int size;
-  int occupied;
-  int crefs;
-  mutex_t lock;
-  FAR epoll_data_t *data;
-  FAR struct pollfd *poll;
-};
+  struct list_node      node;
+  epoll_data_t          data;
+  struct pollfd         pfd;
+} epoll_node_t;
+
+typedef struct epoll_head_s
+{
+  int                   size;
+  int                   crefs;
+  mutex_t               lock;
+  sem_t                 sem;
+  struct list_node      setup;    /* The setup list, store all the setuped
+                                   * epoll node.
+                                   */
+  struct list_node      teardown; /* The teardown list, store all the epoll
+                                   * node notified after epoll_wait finish,
+                                   * these epoll node should be setup again
+                                   * to check the pending poll notification.
+                                   */
+  struct list_node      free;     /* The free list, store all the freed epoll
+                                   * node.
+                                   */
+  struct list_node      extend;   /* The extend list, store all the malloced
+                                   * first node, used to free the malloced
+                                   * memory in epoll_do_close().
+                                   */
+} epoll_head_t;

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7642: fs_epoll: support extend the epoll dynamicly.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7642:
URL: https://github.com/apache/incubator-nuttx/pull/7642


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7642: fs_epoll: support extend the epoll dynamicly.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7642:
URL: https://github.com/apache/incubator-nuttx/pull/7642#discussion_r1028971689


##########
fs/vfs/fs_epoll.c:
##########
@@ -36,23 +36,45 @@
 #include <nuttx/clock.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/list.h>
 #include <nuttx/mutex.h>
+#include <nuttx/signal.h>
 
 #include "inode/inode.h"
 
 /****************************************************************************
  * Private Types
  ****************************************************************************/
 
-struct epoll_head
+typedef struct epoll_node_s
 {
-  int size;
-  int occupied;
-  int crefs;
-  mutex_t lock;
-  FAR epoll_data_t *data;
-  FAR struct pollfd *poll;
-};
+  struct list_node      node;
+  epoll_data_t          data;
+  struct pollfd         pfd;
+} epoll_node_t;
+
+typedef struct epoll_head_s
+{
+  int                   size;
+  int                   crefs;
+  mutex_t               lock;
+  sem_t                 sem;
+  struct list_node      setup;    /* The setup list, store all the setuped
+                                   * epoll node.
+                                   */
+  struct list_node      teardown; /* The teardown list, store all the epoll
+                                   * node notified after epoll_wait finish,
+                                   * these epoll node should be setup again
+                                   * to check the pending poll notification.
+                                   */
+  struct list_node      free;     /* The free list, store all the freed epoll
+                                   * node.
+                                   */
+  struct list_node      extend;   /* The extend list, store all the malloced
+                                   * first node, used to free the malloced
+                                   * memory in epoll_do_close().
+                                   */
+} epoll_head_t;

Review Comment:
   ditto



##########
fs/vfs/fs_epoll.c:
##########
@@ -36,23 +36,45 @@
 #include <nuttx/clock.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/list.h>
 #include <nuttx/mutex.h>
+#include <nuttx/signal.h>
 
 #include "inode/inode.h"
 
 /****************************************************************************
  * Private Types
  ****************************************************************************/
 
-struct epoll_head
+typedef struct epoll_node_s
 {
-  int size;
-  int occupied;
-  int crefs;
-  mutex_t lock;
-  FAR epoll_data_t *data;
-  FAR struct pollfd *poll;
-};
+  struct list_node      node;
+  epoll_data_t          data;
+  struct pollfd         pfd;
+} epoll_node_t;

Review Comment:
   I'm not sure about the style here. In many places I see stye like
   ```
   struct epoll_node_s
   {
     struct list_node      node;
     epoll_data_t          data;
     struct pollfd         pfd;
   };
   
   typedef struct epoll_node_s epoll_node_t;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] CV-Bowen commented on a diff in pull request #7642: fs_epoll: support extend the epoll dynamicly.

Posted by GitBox <gi...@apache.org>.
CV-Bowen commented on code in PR #7642:
URL: https://github.com/apache/incubator-nuttx/pull/7642#discussion_r1028988553


##########
fs/vfs/fs_epoll.c:
##########
@@ -36,23 +36,45 @@
 #include <nuttx/clock.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/list.h>
 #include <nuttx/mutex.h>
+#include <nuttx/signal.h>
 
 #include "inode/inode.h"
 
 /****************************************************************************
  * Private Types
  ****************************************************************************/
 
-struct epoll_head
+typedef struct epoll_node_s
 {
-  int size;
-  int occupied;
-  int crefs;
-  mutex_t lock;
-  FAR epoll_data_t *data;
-  FAR struct pollfd *poll;
-};
+  struct list_node      node;
+  epoll_data_t          data;
+  struct pollfd         pfd;
+} epoll_node_t;

Review Comment:
   You are right, i will update.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org