In preemptive real-time systems, a tighter estimate of the Worst Case Response Time(WCRT) of the tasks can be obtained if the layout of the tasks in memory is included in the estimation procedure. This is because the Cache Related Preemption Delay(CRPD) depends on the inter-task interference in the cache. We develop a response time analysis framework which takes the layout of the tasks into account. We present an ILP formulation which generates a layout of the tasks such that all timing constraints are satisfied. To overcome the issue of non-scalability associated with an ILP solution, we also present a linear programming relaxation of the ILP formulation, which offers an approximate solution. The performance of the proposed formulation is demonstrated.