Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-19 Thread Trevor Woerner
On Tue, Sep 19, 2017 at 12:12 AM, Seebs  wrote:
> On Mon, 18 Sep 2017 19:41:03 -0400
> Trevor Woerner  wrote:
>
>> Would you be open to a co-maintainership? Maybe a co-maintainer who
>> doesn't push to master directly?
>
> Maybe? I don't know, I'd need to think about that a bit. I recognize
> that there's a need to get some of this stuff fixed, but I think the
> amount of busy I've been recently is probably transient and not likely
> to happen very often.

Okay, sounds good. I'm glad to hear it's just a transient thing. I was
under a mistaken impression.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-19 Thread Burton, Ross
On 19 September 2017 at 00:16, Trevor Woerner  wrote:

> It doesn't make sense to carry these large patches against pseudo in
> OE itself. Isn't pseudo one of the tools under The Yocto Project
> umbrella? Adding patches to a recipe is what happens when upstream
> isn't under our control, isn't responsive, or isn't cooperating.
>
> Can someone volunteer to be the active maintainer of it and get commit
> access? I'll volunteer, if nobody else does. But if I become the
> maintainer, I'll need some time to get up-to-speed, or some potential
> support from the current maintainer.


This patch may not yet be acceptable "upstream" but is sufficient for our
purposes, and we've obviously got a good relationship with "upstream" so
carrying it in oe-core is a short-term measure.

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-18 Thread Seebs
On Mon, 18 Sep 2017 19:41:03 -0400
Trevor Woerner  wrote:

> Would you be open to a co-maintainership? Maybe a co-maintainer who
> doesn't push to master directly?

Maybe? I don't know, I'd need to think about that a bit. I recognize
that there's a need to get some of this stuff fixed, but I think the
amount of busy I've been recently is probably transient and not likely
to happen very often.

-s
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-18 Thread Trevor Woerner
On Mon, Sep 18, 2017 at 7:18 PM, Seebs  wrote:
> On Mon, 18 Sep 2017 19:16:13 -0400
> Trevor Woerner  wrote:
>
>> It doesn't make sense to carry these large patches against pseudo in
>> OE itself. Isn't pseudo one of the tools under The Yocto Project
>> umbrella?
>
> Yes. But the pool of people with the variety of expertise needed to
> maintain it isn't huge, and *normally* I'm more responsive, I'm just
> extra busy the last couple of months.

Would you be open to a co-maintainership? Maybe a co-maintainer who
doesn't push to master directly?
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-18 Thread Seebs
On Mon, 18 Sep 2017 19:16:13 -0400
Trevor Woerner  wrote:

> It doesn't make sense to carry these large patches against pseudo in
> OE itself. Isn't pseudo one of the tools under The Yocto Project
> umbrella?

Yes. But the pool of people with the variety of expertise needed to
maintain it isn't huge, and *normally* I'm more responsive, I'm just
extra busy the last couple of months.

-s
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-18 Thread Trevor Woerner
It doesn't make sense to carry these large patches against pseudo in
OE itself. Isn't pseudo one of the tools under The Yocto Project
umbrella? Adding patches to a recipe is what happens when upstream
isn't under our control, isn't responsive, or isn't cooperating.

Can someone volunteer to be the active maintainer of it and get commit
access? I'll volunteer, if nobody else does. But if I become the
maintainer, I'll need some time to get up-to-speed, or some potential
support from the current maintainer.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCHv2] pseudo: use epoll API on Linux

2017-09-18 Thread Alexander Kanavin
The idea came up here:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11309
and here:
http://lists.openembedded.org/pipermail/openembedded-core/2017-August/141491.html

Signed-off-by: Alexander Kanavin 
---
 .../pseudo/files/0001-Use-epoll-API-on-Linux.patch | 273 +
 meta/recipes-devtools/pseudo/pseudo_1.8.2.bb   |   1 +
 2 files changed, 274 insertions(+)
 create mode 100644 
meta/recipes-devtools/pseudo/files/0001-Use-epoll-API-on-Linux.patch

diff --git 
a/meta/recipes-devtools/pseudo/files/0001-Use-epoll-API-on-Linux.patch 
b/meta/recipes-devtools/pseudo/files/0001-Use-epoll-API-on-Linux.patch
new file mode 100644
index 000..2e304f9811c
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/0001-Use-epoll-API-on-Linux.patch
@@ -0,0 +1,273 @@
+From 55fe7dc646f560bdf79309bc8677902e53686d65 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin 
+Date: Fri, 15 Sep 2017 17:00:14 +0300
+Subject: [PATCH] Use epoll API on Linux
+
+Upstream-Status: Submitted [Seebs CC'd by email]
+Signed-off-by: Alexander Kanavin 
+
+
+Signed-off-by: Alexander Kanavin 
+---
+ enums/exit_status.in |   3 +
+ pseudo_server.c  | 178 ++-
+ 2 files changed, 179 insertions(+), 2 deletions(-)
+
+diff --git a/enums/exit_status.in b/enums/exit_status.in
+index 6be44d3..88f94cd 100644
+--- a/enums/exit_status.in
 b/enums/exit_status.in
+@@ -18,3 +18,6 @@ listen_fd, "server loop had no valid listen fd"
+ pseudo_loaded, "server couldn't get out of pseudo environment"
+ pseudo_prefix, "couldn't get valid pseudo prefix"
+ pseudo_invocation, "invalid server command arguments"
++epoll_create, "epoll_create() failed"
++epoll_ctl, "epoll_ctl() failed"
++
+diff --git a/pseudo_server.c b/pseudo_server.c
+index ff16efd..09c43e4 100644
+--- a/pseudo_server.c
 b/pseudo_server.c
+@@ -40,6 +40,12 @@
+ #include "pseudo_client.h"
+ #include "pseudo_db.h"
+ 
++// This has to come after pseudo includes, as that's where PSEUDO_PORT 
defines are
++#ifdef PSEUDO_PORT_LINUX
++#include 
++#endif
++
++
+ static int listen_fd = -1;
+ 
+ typedef struct {
+@@ -59,6 +65,7 @@ static int active_clients = 0, highest_client = 0, 
max_clients = 0;
+ 
+ #define LOOP_DELAY 2
+ #define DEFAULT_PSEUDO_SERVER_TIMEOUT 30
++#define EPOLL_MAX_EVENTS 10
+ int pseudo_server_timeout = DEFAULT_PSEUDO_SERVER_TIMEOUT;
+ static int die_peacefully = 0;
+ static int die_forcefully = 0;
+@@ -80,7 +87,11 @@ quit_now(int signal) {
+ static int messages = 0, responses = 0;
+ static struct timeval message_time = { .tv_sec = 0 };
+ 
++#ifdef PSEUDO_PORT_LINUX
++static void pseudo_server_loop_epoll(void);
++#else
+ static void pseudo_server_loop(void);
++#endif
+ 
+ /* helper function to make a directory, just like mkdir -p.
+  * Can't use system() because the child shell would end up trying
+@@ -369,12 +380,16 @@ pseudo_server_start(int daemonize) {
+   kill(ppid, SIGUSR1);
+   }
+   }
++#ifdef PSEUDO_PORT_LINUX
++  pseudo_server_loop_epoll();
++#else
+   pseudo_server_loop();
++#endif
+   return 0;
+ }
+ 
+ /* mess with internal tables as needed */
+-static void
++static unsigned int
+ open_client(int fd) {
+   pseudo_client_t *new_clients;
+   int i;
+@@ -390,7 +405,7 @@ open_client(int fd) {
+   ++active_clients;
+   if (i > highest_client)
+   highest_client = i;
+-  return;
++  return i;
+   }
+   }
+ 
+@@ -414,9 +429,11 @@ open_client(int fd) {
+ 
+   max_clients += 16;
+   ++active_clients;
++  return max_clients - 16;
+   } else {
+   pseudo_diag("error allocating new client, fd %d\n", fd);
+   close(fd);
++  return 0;
+   }
+ }
+ 
+@@ -566,6 +583,162 @@ serve_client(int i) {
+   }
+ }
+ 
++#ifdef PSEUDO_PORT_LINUX
++static void pseudo_server_loop_epoll(void)
++{
++  struct sockaddr_un client;
++  socklen_t len;
++int i;
++int rc;
++int fd;
++  int timeout;
++  struct epoll_event ev, events[EPOLL_MAX_EVENTS];
++  int loop_timeout = pseudo_server_timeout;
++
++  clients = malloc(16 * sizeof(*clients));
++
++  clients[0].fd = listen_fd;
++  clients[0].pid = getpid();
++
++  for (i = 1; i < 16; ++i) {
++  clients[i].fd = -1;
++  clients[i].pid = 0;
++  clients[i].tag = NULL;
++  clients[i].program = NULL;
++  }
++
++  active_clients = 1;
++  max_clients = 16;
++  highest_client = 0;
++
++  pseudo_debug(PDBGF_SERVER, "server loop started.\n");
++  if (listen_fd < 0) {
++  pseudo_diag("got into loop with no valid listen fd.\n");
++  exit(PSEUDO_EXIT_LISTEN_FD);
++  }
++
++