Latency in GPIO interrupts

I am trying to implement an interrupt routine with an incoming interrupt every 25us(microseconds). Basically on each interrupt, I will set another gpio, output gpio, high for around 25us and reset the gpio to low after. I measured the input from the interrupt gpio and the output gpio. I realised that my callback/interrupt routine only executes about every 500us. I would like to know there is a way to increase the reaction to interrupt.

I am using the SBC ccimx6ul pro with the Digi yocto os.

We have done some interrupt latency performance measurements (1) for Cortex A8 (note the i.MX6UL has cortex A7 though) with the following numbers:

No preempt: 293us
Preempt: 88us
Preempt RT: 55us
Those are coherent with the GPIO-API measurements on the CC6UL on non-preempted kernels, so I’d say that around 50us for fully preemptible kernels is the theoretical maximum.

(1)https://events.static.linuxfound.org/sites/events/files/slides/toyooka_LCJ2014_v10.pdf