Christoph Hellwig
2022-Nov-29 14:02 UTC
[Ocfs2-devel] [PATCH v1 2/3] Treewide: Stop corrupting socket's task_frag
Hmm. Having to set a flag to not accidentally corrupt per-task state seems a bit fragile. Wouldn't it make sense to find a way to opt into the feature only for sockets created from the syscall layer?
Benjamin Coddington
2022-Nov-29 16:47 UTC
[Ocfs2-devel] [PATCH v1 2/3] Treewide: Stop corrupting socket's task_frag
On 29 Nov 2022, at 9:02, Christoph Hellwig wrote:> Hmm. Having to set a flag to not accidentally corrupt per-task > state seems a bit fragile. Wouldn't it make sense to find a way to opt > into the feature only for sockets created from the syscall layer?It's totally fragile, and that's why it's currently broken in production. The fragile ship sailed when networking decided to depend on users setting the socket's GFP_ flags correctly to avoid corruption. Meantime, this problem needs fixing in a way that makes everyone happy. This fix doesn't make it less fragile, but it may (hopefully) address the previous criticisms enough that something gets done to fix it. Ben
Jeff Layton
2022-Nov-29 17:42 UTC
[Ocfs2-devel] [PATCH v1 2/3] Treewide: Stop corrupting socket's task_frag
On Tue, 2022-11-29 at 15:02 +0100, Christoph Hellwig wrote:> Hmm. Having to set a flag to not accidentally corrupt per-task > state seems a bit fragile. Wouldn't it make sense to find a way to opt > into the feature only for sockets created from the syscall layer?I agree that that would be cleaner. task_frag should have been an opt-in thing all along. That change regressed all of the in-kernel users of sockets. Where would be the right place to set that flag for only userland sockets? A lot of the in-kernel socket users hook into the socket API at a fairly high-level. 9P and CIFS, for instance, call __sock_create. We could set it in the syscall handlers (and maybe in iouring) I suppose, but that seems like the wrong thing to do too. In the absence of a clean place to do this, I think we're going to be stuck doing it the way Ben has proposed... -- Jeff Layton <jlayton at kernel.org>
Guillaume Nault
2022-Nov-30 11:48 UTC
[Ocfs2-devel] [PATCH v1 2/3] Treewide: Stop corrupting socket's task_frag
On Tue, Nov 29, 2022 at 03:02:42PM +0100, Christoph Hellwig wrote:> Hmm. Having to set a flag to not accidentally corrupt per-task > state seems a bit fragile. Wouldn't it make sense to find a way to opt > into the feature only for sockets created from the syscall layer?That's something I originally considered. But, as far as I can see, nbd needs this flag _and_ uses sockets created in user space. So it'd still need to opt out manually.