Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbbDFQyq (ORCPT ); Mon, 6 Apr 2015 12:54:46 -0400 Received: from mail.skyhub.de ([78.46.96.112]:34051 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbbDFQyo (ORCPT ); Mon, 6 Apr 2015 12:54:44 -0400 Date: Mon, 6 Apr 2015 18:52:36 +0200 From: Borislav Petkov To: Sasha Levin Cc: LKML , Rusty Russell , Dave Jones , Michal Hocko , Linus Torvalds Subject: Re: Hang on large copy_from_user with PREEMPT_NONE Message-ID: <20150406165236.GE4078@pd.tnic> References: <552204B8.40605@oracle.com> <20150406112419.GB4078@pd.tnic> <55229D7E.6080309@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55229D7E.6080309@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 70 On Mon, Apr 06, 2015 at 10:51:42AM -0400, Sasha Levin wrote: > > Btw, what's happening to that user pointer in %rdi, is it kosher? > > Probably not. Trinity passes random addresses into that syscall, so it's probably one of it's magic > values. So what is the expectation? If that pointer goes away from under us, userspace is supposed to get some signal instead of hanging? > I've attached dmesg with debug-alternative, and my .config. vmlinux is pretty > large (1GB compressed) so hopefully the config would be enough - let me know > if it isn't. Thanks, I'll give it a try and do some staring tomorrow. Still a holiday today here :-) > > Btw, that zerorest is being tested on every loop iteration! AFAICT, > > > > if (!zerorest) { > > clac(); > > return len; > > } > > > > before the loop should be nicer. Or am I missing something? > > Looks good to me. I suspect the compiler optimizes that anyway though. Yeah, doesn't look like it. See the e: 85 c9 test %ecx,%ecx ? That's: --- testl %esi, %esi # __pu_err je .L34 #, .L21: testl %ecx, %ecx # zerorest <--- je .L33 #, movl %edx, %eax # len, len xorl %r8d, %r8d # tmp194 jmp .L27 # .p2align 4,,7 .p2align 3 .L35: decl %eax # len movq %rsi, %rdi # to, to je .L33 #, .L27: leaq 1(%rdi), %rsi #, to --- and my asm is not so different from yours so that I can match your asm with the .s output here. Anyway, that's a different story, I'll do a fix for it. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/